Conversation
548241d to
a983100
Compare
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.
Add Secondary Market Support and Infrastructure Improvements
Overview
This pull request introduces a complete secondary market solution for the Digital Original (DO) protocol, enabling peer-to-peer NFT trading through off-chain order matching. Additionally, it includes significant infrastructure improvements, refactoring, and enhanced error handling across the entire codebase.
Key Features
🏪 New Market Contract
Introduced a comprehensive secondary market system (
Market.sol) that facilitates trustless peer-to-peer trading:CurrencyManager📚 New Libraries and Components
Order.sol): Defines the order structure and EIP-712 hashingExecutionPermit.sol): Handles execution permissions with revenue distributionSafeERC20BulkTransfer.sol): Safe bulk transfer utility for distributing fundsCurrencyManager.sol): Manages supported payment currencies🔧 Infrastructure Improvements
Refactored Components
Deployer.sol→CollectionDeployer.solfor clarityDeployerTest.sol→AllDeployer.solMarketDeployer.solfor market deploymentEnhanced Error Handling
RoleSystemUnauthorizedAccounterror with detailed role informationDistributionSharesSumTooBigandDistributionSharesSumTooLowinto singleDistributionSharesSumInvaliderrorDocumentation
🛠️ Development Tools
New Deployment Scripts
deploy-market.ts: Deploy market infrastructuredeploy-market-impl.ts: Deploy market implementationverify-market.ts: Etherscan verification for market contractsConfiguration
config.market.yamlfor market-specific parameters✅ Comprehensive Testing
Added extensive test coverage for:
Market.ts)CurrencyManager.ts)market-utils.ts)Technical Changes Summary
Files Added
Files Modified
Testing
The new market functionality has been thoroughly tested with comprehensive unit tests covering:
Security Considerations
Deployment Notes
npx hardhat deploy-market-impl --network <network>npx hardhat deploy-market --network <network>npx hardhat verify-market --network <network>