Skip to content

release: promote dev to main - #25

Merged
dadadave80 merged 29 commits into
mainfrom
dev
Aug 26, 2026
Merged

release: promote dev to main#25
dadadave80 merged 29 commits into
mainfrom
dev

Conversation

@dadadave80

Copy link
Copy Markdown
Member

Summary

  • add direct organizer payments and off-chain fiat ticket payments
  • refactor marketplace, factory, check-in, and ticket lifecycle libraries
  • expand fuzz, edge-case, and lifecycle test coverage
  • update Forge dependencies and pin the Tokenbound fork
  • add Arc testnet support and dimensional annotations

Verification

  • full Forge suite: 218 tests passed

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
…nizer

feat: direct payment to organizer for non-refundable tickets
Annotate variables, parameters, and expressions with inline // {unit}
comments to document dimensional types (tok, s, ticket, ticketId, etc.)
across all contract source files.
Update foundry.lock to track lattice in place of diamond-lib, and
advance the lib/lattice gitlink to 71c9d6a8 so the working tree
matches the locked revision. Resolves the revision-mismatch warning
emitted by forge build.
… funcs

Inline each lib's storage/errors/logs files into the parent library so
that FactoryLib, MarketplaceLib, and CheckInLib are each self-contained
in a single file. Rename Lib<Name> -> <Name>Lib to put the role at the
end of the identifier, and rename script/helpers/LibAddressesAndFees ->
AddressesAndFees for the same reason.

Drop the leading underscore from every internal library function so
call sites read like FactoryLib.checkTicketExists(...) instead of
FactoryLib._checkTicketExists(...). Private helpers keep the prefix.
Update every caller in facets, inits, interfaces, scripts, and tests.

LibContext is replaced by the diamond library's ContextLib. The
duplicate-fee guard inside createTicket is preserved so passing the
same FeeType twice in a single call still reverts FeeAlreadySet, while
setTicketFees now allows updates to existing per-ticket fees.
Bring in the lattice submodule + foundry.lock alignment, the lib
structural flatten, and the drop-underscore-on-internal-funcs rename.
- HostItTickets: gate initialize() with INITIALIZER_ROLE granted in the
  constructor; pass tx.origin from the deploy helper so the role and the
  broadcaster of initialize() always match.
- HostItInit: rename MarketplaceLib._setFeeTokenAddresses ->
  setFeeTokenAddresses to match the flattened lib naming.
- Facets: move addTicketAdmins / removeTicketAdmins from CheckInFacet to
  FactoryFacet (with backing FactoryLib impls and events); rename
  MarketplaceFacet.setTicketFees -> updateTicketFees and keep the
  internal MarketplaceLib.setTicketFees as a shared helper.
- MarketplaceLib: refund excess ETH on overpaid mint, tighten fee-config
  validation (reject empty/mismatched arrays), include FeeType in the
  ZeroFee error, and drop underscores on setFeeTokenAddresses /
  getFeeTokenAddress.
- FactoryLib: route paid-ticket fee setup through MarketplaceLib and
  consolidate the admin add/remove flow here.
- Tests: update suites to the new admin / fee APIs.
- Deps: bump lattice submodule and foundry.lock.
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.
feat(marketplace): add off-chain fiat payments
@dadadave80
dadadave80 merged commit 88d05a0 into main Aug 26, 2026
2 checks passed
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