feat(marketplace): add off-chain fiat payments - #24
Merged
Conversation
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.
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
forge test --match-path test/Marketplace.t.sol