release: promote dev to main - #25
Merged
Merged
Conversation
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
test: add fuzz tests and increase coverage
Annotate variables, parameters, and expressions with inline // {unit}
comments to document dimensional types (tok, s, ticket, ticketId, etc.)
across all contract source files.
docs: dimensional analysis annotations
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification