@blockyard
Rare24 Miniapp Public build
Day 3: Contract Architecture
We will build 3 modular contracts + shared libraries for clean, auditable code. Here's the system design:
Entry Point: Rare24.sol
- Imports ERC1155 & ReentrancyGuard
- Executes core logic across modules
Module 1: Main.sol
- createPhoto(), mintPhoto(), batchMintPhotos()
- The minting engine creators & followers use
Module 2: TradeNft.sol
- P2P trading between collectors
- proposeTrade() → accept/reject/cancel → counterOffer()
Module 3: ResellNft.sol
- Secondary market mechanics
- createBuyOffer() → accept/reject/cancel → refund logic
Shared Libraries:
StructLibrary - Type definitions
ErrorsLibrary - Gas-efficient errors
EventsLibrary - Event standards
As stated earlier, modularity allows for easier audits, cleaner upgrades and better testing.
Tomorrow we will execute the logics and write test functions.