Skip to content

feat(marketplace): add off-chain fiat payments - #24

Merged
dadadave80 merged 6 commits into
devfrom
feat/fiat-offchain-payments
Aug 26, 2026
Merged

feat(marketplace): add off-chain fiat payments#24
dadadave80 merged 6 commits into
devfrom
feat/fiat-offchain-payments

Conversation

@dadadave80

Copy link
Copy Markdown
Member

Summary

  • add trusted-backend direct fiat ticket minting
  • add EIP-712 fiat voucher redemption and batch operations
  • add replay protection, fiat accounting, guards, and marketplace tests

Verification

  • forge test --match-path test/Marketplace.t.sol
  • 124 tests passed

Switches from a contract-wide Pausable model to a per-token used flag.
Check-in now calls Ticket.useTicket(tokenId), which marks the token as
used and blocks future transfers via onlyUnused on transferFrom and
safeTransferFrom. Refunds bypass the used check by going through a new
admin-only refundTicket function backed by _update.

Also adds checkInBatch for checking in multiple token holders in a
single call and drops the no-longer-needed UUPSUpgradeable inheritance
on Ticket.
…add Arc testnet support

Renames the FeeType enum's ETH and WETH variants to NATIVE and WNATIVE
to better reflect non-Ethereum chains where the native token is not ETH
(e.g. AVAX, MNT). Also folds in several Marketplace cleanups gathered for
the pre-audit pass:

- Reorder mintTicket sold-out check before time checks; cache msgSender
- Fix off-by-one in maxTicketsPerUser check (> -> >=) so the cap is
  inclusive; bump test data maxTicketsPerUser from 0 to 1 to match
- Move hostItBalance accumulation out of the refundable/non-refundable
  branches
- Defer ERC20 balance/allowance checks until after the transfer attempt
  (cheaper happy path, same error surface)
- Add msg.sender overload of claimRefund
- Rename _feeEnabled to a feeEnabled overload
- Drop unused HostItFeeBpsSet event and InvalidHostItFeeBps,
  TicketNotApproved errors
- Use forceSafeTransferETH in withdrawTicketBalance to match
  withdrawHostItBalance

Adds Arc testnet (chainId 5042002) to AddressesAndFees and foundry.toml,
drops leading underscores on AddressesAndFees getters (and updates the
deploy helper), and removes CREATE2 salts from the deploy helper.
- HostItTickets: derive INITIALIZER_ROLE from a namespaced hash instead
  of using 0x00 (which collided with the default admin role), and
  replace the ETHTransferFailed receive() revert with a dedicated
  DirectETHTransferNotAllowed error so the cause is unambiguous
- FactoryLib: cast block.timestamp through SafeCastLib.toUint48 before
  comparing against uint48 schedule fields; fix update path that read
  the caller-provided startTime instead of the stored extraTicketData
  startTime when validating endTime and purchaseStartTime; mark the
  role-hash assembly blocks as memory-safe
- gitignore: skip local audit/, x-ray/, and .obsidian working trees
Why: blocking contract addresses prevented multisigs/Safes from
receiving
ticket and HostIt withdrawals. Also ignore local audit-prep notes.
@dadadave80
dadadave80 merged commit cee962d into dev Aug 26, 2026
1 check passed
@dadadave80
dadadave80 deleted the feat/fiat-offchain-payments branch August 26, 2026 15:17
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