Skip to content

Dev#18

Merged
dadadave80 merged 35 commits intomainfrom
dev
Mar 13, 2026
Merged

Dev#18
dadadave80 merged 35 commits intomainfrom
dev

Conversation

@dadadave80
Copy link
Member

@dadadave80 dadadave80 commented Nov 3, 2025

Description

This PR introduces significant architectural improvements, new features for the ticketing and marketplace systems, and several critical bug fixes. The primary focus of this release is migrating to a more robust diamond standard implementation, adding refund and instant withdrawal capabilities, and improving the stability of our deployment and test suites.

🚀 Features & Enhancements

  • Ticket Refunds & Cancellations:
    • Enabled refund claim functionality in the marketplace.
    • Added isRefundable logic to ticket creation and processing.
    • Enabled instant withdrawals for non-refundable tickets.
  • Expanded Deployment Support:
    • Added deployment configurations and addresses for Mantle (Mainnet & Sepolia) and Lisk.
  • Enhanced Ticket Data:
    • Introduced maxTicketsPerUser to the ticket data structure to enforce per-user purchasing limits.
    • Updated ticket creation functions to return the newly created ticketId for easier downstream processing.

🏗️ Architecture & Refactoring

  • Diamond Standard Migration:
    • Replaced the deprecated erc2535-diamond-template with the modernized diamond-lib as a git submodule.
    • Updated constructor signatures and separated diamond deployment logic from HostItTickets facet initialization.
  • Marketplace & Fee Logic:
    • Refactored HostIt fee calculation logic.
    • Reordered and optimized functions within LibMarketplace for better gas efficiency and readability.
  • Storage & Types Optimization:
    • Migrated time-related variables to uint48 to prevent year-2038 issues while optimizing storage packing.
    • Updated tokenId variables to use uint40 for tighter struct packing.

🐛 Bug Fixes

  • Test Suite Stability: Fixed the Unauthorized() revert in test setUp() phases by properly inlining the diamond deployment and ensuring the correct msg.sender executes the diamondCut initialization.
  • CI Integration: Fixed the Foundry Test GitHub Actions CI pipeline and updated ignore rules to prevent committing broadcast logs.
  • Event Logging: Removed redundant indexed keywords from array types in logs which caused compilation and decoding issues.

🧹 Maintenance & Developer Experience

  • Added comprehensive NatSpec documentation and custom storage layout comments across core libraries and facets.
  • Cleaned up debug console2 logs from deployment scripts and reorganized script helper imports.
  • Updated standard .env.example configurations.
  • Added the "Ask DeepWiki" badge to the README.md.
  • Disabled metadata hash generation in foundry.toml to ensure deterministic bytecode verification.

🧪 Testing

  • Added comprehensive tests for refund claims (test_claimRefundETH, test_claimRefundUSDC, etc.) and instant withdrawals.
  • Verified that all 46 core logic tests across Factory, CheckIn, and Marketplace pass successfully.

Removed the erc2535-diamond-template submodule and references, and added diamond-lib as a new submodule. Updated remappings to point to diamond-lib paths instead of erc2535-diamond-template.
Replaces ERC165Init with DiamondInit in deployment and helper scripts. Updates the helper to generate initialization calldata instead of DiamondArgs, aligning with new contract initialization requirements.
Refactored the HostItTickets contract constructor to accept FacetCut array, init contract address, and calldata directly, aligning with the updated Diamond contract interface. Updated parameter names and documentation accordingly.
Introduces the diamond-lib repository as a submodule under lib/. This allows the project to track and use code from diamond-lib at commit 95faf293ac04cb21f41fcf2ae4f51f68fba037ec.
Refreshed revisions for several libraries and added diamond-lib to the lock file to ensure the latest versions are used.
Added a clarifying comment before the call to _getAddressesAndFeesByChainId to improve code readability.
Moved the _createErc6551Account function to a new location within the LibMarketplace library and removed unused refund-related functions. This improves code organization and removes incomplete or placeholder code.
Introduces claimRefund to MarketplaceFacet and IMarketplace, allowing users to claim ticket refunds within a specified period. Updates LibMarketplace with internal refund logic, new error types, and related event emissions. Refactors fee setting and withdrawal logic for consistency and improved event handling.
Updates LibFactory to set maxTicketsPerUser in extraTicketData if provided. Also changes updatedAt field to use uint48 for increased timestamp range.
Added tests for claiming ticket refunds in ETH, USDT, and USDC to MarketplaceTest. Updated DeployedHostItTickets to set isRefundable to true for paid tickets, enabling refund functionality in tests.
Changed EIP-2535 to ERC-2535 in HostItTickets documentation for accuracy. Updated TicketProxy constructor to be payable, allowing it to receive Ether.
Replaced dynamic HostIt fee basis points with a constant, refactored fee calculation to use pure functions, and removed related setter logic. Updated IMarketplace interface with detailed documentation and adjusted function signatures. Added HOST_IT_SALT to .env.example for deployment configuration.
The createTicket function in FactoryFacet, IFactory, and LibFactory now returns the ticket ID (uint64) after creation. This change allows callers to immediately obtain the new ticket's identifier for further processing or reference.
Also removed unused fee bps from storage
@dadadave80 dadadave80 merged commit 14e47e3 into main Mar 13, 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