The puzzle factory contract has been built and is ready for deployment:
- WASM File:
target/wasm32v1-none/release/puzzle_factory.wasm - Size: 18,551 bytes
- Hash:
4ea640f52d13350400b81d11c9e29977b9de853c19f679fd7f6f036c4f840d3e
puzzle_deployer(for testnet)puzzle_deployer_futurenet(for futurenet)
stellar contract deploy \
--wasm target/wasm32v1-none/release/puzzle_factory.wasm \
--source puzzle_deployer \
--network testnetstellar contract deploy \
--wasm target/wasm32v1-none/release/puzzle_factory.wasm \
--source puzzle_deployer_futurenet \
--network futurenetmake deploy-testnetAfter deployment, you'll need to initialize the contract:
# Replace CONTRACT_ID with the deployed contract address
stellar contract invoke \
--id CONTRACT_ID \
--source puzzle_deployer \
--network testnet \
-- initialize \
--admin ADMIN_ADDRESSThe deployed contract includes these main functions:
initialize(admin)- Initialize contract with adminauthorize_creator(creator)- Authorize a puzzle creatorcreate_puzzle(...)- Create a new puzzledeprecate_puzzle(puzzle_id)- Deprecate a puzzle (with full cleanup)get_puzzle(puzzle_id)- Get puzzle detailsget_puzzles_by_category(category)- Filter by categoryget_puzzles_by_creator(creator)- Filter by creatorget_puzzles_by_difficulty(difficulty)- Filter by difficultyget_active_puzzles()- Get all active puzzlesget_creator_stats(creator)- Get creator statistics
If you encounter SSL certificate errors like:
error: Networking or low-level protocol error: HTTP error: error trying to connect: invalid peer certificate: UnknownIssuer
Try these solutions:
-
Update Stellar CLI (recommended):
# If installed via homebrew brew install stellar # Or download latest from GitHub releases
-
Use different network endpoint:
stellar network add testnet "https://horizon-testnet.stellar.org" -
Check system certificates:
# On macOS sudo security update-certs # Or try with insecure flag (not recommended for production) stellar contract deploy --insecure ...
✅ Puzzle Factory and Registry
- Complete puzzle creation and metadata storage
- Creator attribution and royalty tracking
- Multi-index filtering (category, creator, difficulty, status)
- Access control with authorized creators
- Enhanced deprecation logic with full cleanup
✅ Enhanced Deprecation Logic
- Removes puzzle from all indexes (category, creator, difficulty)
- Updates creator statistics accurately
- Cleans up empty index entries
- Prevents double deprecation
- Comprehensive test coverage
✅ Testing
- 6 comprehensive tests covering all functionality
- All tests passing successfully
- Resolve network connectivity issue
- Deploy contract using one of the commands above
- Initialize contract with admin address
- Authorize creators and start creating puzzles
- Test the enhanced deprecation functionality