Skip to content

Sandbox Passes contract #1619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 97 commits into
base: master
Choose a base branch
from
Open

Sandbox Passes contract #1619

wants to merge 97 commits into from

Conversation

wojciech-turek
Copy link
Member

@wojciech-turek wojciech-turek commented Jan 7, 2025

SandboxPasses1155Upgradeable Implementation

This PR introduces a comprehensive, feature-rich ERC1155 implementation for The
Sandbox passes ecosystem. The contract provides a flexible foundation for
digital passes, membership tokens, and access credentials with robust security,
configurability, and user experience features.

Spec:
https://docs.google.com/document/d/1zEVOfVYuUWDeD8h13rcUH3o67cRyp4yt1UtXWUAWbk0/edit?pli=1&tab=t.0

Key Features Added

  • Configurable Passes: Each token ID represents a unique pass type with
    customizable properties including transferability, max supply, max per wallet,
    and dedicated treasury address.

  • Flexible Minting: Multiple minting paths including admin minting,
    signature-authorized minting, and burn-to-mint transformations, enabling
    diverse distribution strategies.

  • Soulbound Functionality: Optional non-transferable configuration for
    passes that should remain bound to the original owner, with admin-controlled
    transfer whitelist exceptions.

  • Supply Controls: Granular control over token supply, both globally (max
    supply) and per user (max per wallet), to manage scarcity and fair
    distribution.

  • Security First: Comprehensive role-based access control, EIP-712 signature
    verification, pausable functionality, and meta-transaction support.

  • Payment Integration: Native support for ERC20 token payments with
    configurable treasury addresses per token type.

  • Upgradeable Design: Implemented using OpenZeppelin's upgradeable contracts
    pattern to allow for future improvements without migration.

  • Royalty Support: Complete ERC2981 implementation for marketplace royalties
    on secondary sales.

Technical Implementation

The contract extends multiple OpenZeppelin base contracts including
ERC1155SupplyUpgradeable, AccessControlUpgradeable, ERC2981Upgradeable, and
PausableUpgradeable. It uses structured storage patterns compatible with the
upgradeable contracts pattern.

Error handling is implemented using custom errors for gas efficiency and
improved debugging. Events are emitted for all significant state changes to
support off-chain indexing and UI updates.

The contract has been thoroughly reviewed for security vulnerabilities and gas
optimization.

@wojciech-turek wojciech-turek requested a review from a team as a code owner January 7, 2025 11:00
@wojciech-turek wojciech-turek changed the title [WIP] Sandbox passes contract Sandbox Passes contract Mar 4, 2025
wojciech-turek and others added 30 commits April 3, 2025 09:43
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.

4 participants