@bayybays/stacksone-sdk 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/clarinet.yaml +33 -0
- package/README.md +444 -0
- package/docs/ARCHITECTURE.md +69 -0
- package/docs/CONTRACT_REGISTRY.md +11 -0
- package/docs/MODULE_OVERVIEW.md +38 -0
- package/docs/ROADMAP_Q1_2026.md +21 -0
- package/docs/SECURITY.md +47 -0
- package/docs/devlog.md +925 -0
- package/docs/notes.md +5 -0
- package/eslint.config.js +29 -0
- package/index.html +24 -0
- package/nonce.txt +1 -0
- package/nonce_store/nonce_1.txt +1 -0
- package/nonce_store/nonce_10.txt +1 -0
- package/nonce_store/nonce_2.txt +1 -0
- package/nonce_store/nonce_3.txt +1 -0
- package/nonce_store/nonce_4.txt +1 -0
- package/nonce_store/nonce_5.txt +1 -0
- package/nonce_store/nonce_6.txt +1 -0
- package/nonce_store/nonce_7.txt +1 -0
- package/nonce_store/nonce_8.txt +1 -0
- package/nonce_store/nonce_9.txt +1 -0
- package/package.json +62 -0
- package/package.json.save +60 -0
- package/postcss.config.js +6 -0
- package/public/logo.png +0 -0
- package/public/vite.svg +1 -0
- package/smart-contracts/.gitattributes +3 -0
- package/smart-contracts/.vscode/settings.json +4 -0
- package/smart-contracts/.vscode/tasks.json +19 -0
- package/smart-contracts/Clarinet.toml +11 -0
- package/smart-contracts/Mainnet.toml +5 -0
- package/smart-contracts/contracts/chaintap.clar +200 -0
- package/smart-contracts/contracts/contract-0.clar +35 -0
- package/smart-contracts/contracts/contract-1.clar +26 -0
- package/smart-contracts/contracts/contract-10.clar +31 -0
- package/smart-contracts/contracts/contract-12.clar +50 -0
- package/smart-contracts/contracts/contract-13.clar +25 -0
- package/smart-contracts/contracts/contract-14.clar +14 -0
- package/smart-contracts/contracts/contract-15.clar +20 -0
- package/smart-contracts/contracts/contract-16.clar +22 -0
- package/smart-contracts/contracts/contract-17.clar +23 -0
- package/smart-contracts/contracts/contract-18.clar +30 -0
- package/smart-contracts/contracts/contract-19.clar +49 -0
- package/smart-contracts/contracts/contract-2.clar +34 -0
- package/smart-contracts/contracts/contract-20.clar +7 -0
- package/smart-contracts/contracts/contract-21.clar +17 -0
- package/smart-contracts/contracts/contract-22.clar +23 -0
- package/smart-contracts/contracts/contract-23.clar +41 -0
- package/smart-contracts/contracts/contract-24.clar +30 -0
- package/smart-contracts/contracts/contract-28.clar +34 -0
- package/smart-contracts/contracts/contract-3.clar +36 -0
- package/smart-contracts/contracts/contract-30.clar +21 -0
- package/smart-contracts/contracts/contract-32.clar +26 -0
- package/smart-contracts/contracts/contract-33.clar +43 -0
- package/smart-contracts/contracts/contract-34.clar +29 -0
- package/smart-contracts/contracts/contract-35.clar +17 -0
- package/smart-contracts/contracts/contract-36.clar +47 -0
- package/smart-contracts/contracts/contract-37.clar +33 -0
- package/smart-contracts/contracts/contract-38.clar +26 -0
- package/smart-contracts/contracts/contract-4.clar +16 -0
- package/smart-contracts/contracts/contract-40.clar +19 -0
- package/smart-contracts/contracts/contract-42.clar +26 -0
- package/smart-contracts/contracts/contract-43.clar +23 -0
- package/smart-contracts/contracts/contract-44.clar +47 -0
- package/smart-contracts/contracts/contract-45.clar +32 -0
- package/smart-contracts/contracts/contract-46.clar +31 -0
- package/smart-contracts/contracts/contract-47.clar +33 -0
- package/smart-contracts/contracts/contract-48.clar +16 -0
- package/smart-contracts/contracts/contract-49.clar +36 -0
- package/smart-contracts/contracts/contract-5.clar +17 -0
- package/smart-contracts/contracts/contract-6.clar +52 -0
- package/smart-contracts/contracts/contract-7.clar +6 -0
- package/smart-contracts/contracts/contract-8.clar +27 -0
- package/smart-contracts/contracts/faucet-distributor-v2.clar +133 -0
- package/smart-contracts/contracts/faucet-distributor-v3.clar +129 -0
- package/smart-contracts/contracts/faucet-distributor-v4.clar +86 -0
- package/smart-contracts/contracts/faucet-distributor-v5.clar +90 -0
- package/smart-contracts/contracts/faucet-distributor-v6.clar +123 -0
- package/smart-contracts/contracts/faucet-distributor-v7.clar +88 -0
- package/smart-contracts/contracts/faucet-distributor.clar +64 -0
- package/smart-contracts/contracts/genesis-0.clar +297 -0
- package/smart-contracts/contracts/genesis-1.clar +342 -0
- package/smart-contracts/contracts/genesis-2.clar +297 -0
- package/smart-contracts/contracts/genesis-3.clar +282 -0
- package/smart-contracts/contracts/genesis-4.clar +291 -0
- package/smart-contracts/contracts/genesis-5.clar +276 -0
- package/smart-contracts/contracts/genesis-6.clar +273 -0
- package/smart-contracts/contracts/genesis-7.clar +261 -0
- package/smart-contracts/contracts/genesis-8.clar +279 -0
- package/smart-contracts/contracts/genesis-9.clar +288 -0
- package/smart-contracts/contracts/genesis-ascension-v1.clar +54 -0
- package/smart-contracts/contracts/genesis-badges-v10.clar +72 -0
- package/smart-contracts/contracts/genesis-badges-v4.clar +66 -0
- package/smart-contracts/contracts/genesis-badges-v5.clar +66 -0
- package/smart-contracts/contracts/genesis-badges-v8.clar +88 -0
- package/smart-contracts/contracts/genesis-badges-v9.clar +66 -0
- package/smart-contracts/contracts/genesis-badges.clar +73 -0
- package/smart-contracts/contracts/genesis-boost-v1.clar +58 -0
- package/smart-contracts/contracts/genesis-core-v10.clar +87 -0
- package/smart-contracts/contracts/genesis-core-v2.clar +86 -0
- package/smart-contracts/contracts/genesis-core-v4.clar +80 -0
- package/smart-contracts/contracts/genesis-core-v5.clar +86 -0
- package/smart-contracts/contracts/genesis-core-v6.clar +98 -0
- package/smart-contracts/contracts/genesis-core-v8.clar +106 -0
- package/smart-contracts/contracts/genesis-core-v9.clar +80 -0
- package/smart-contracts/contracts/genesis-core.clar +93 -0
- package/smart-contracts/contracts/genesis-missions-v4.clar +104 -0
- package/smart-contracts/contracts/genesis-missions-v5.clar +86 -0
- package/smart-contracts/contracts/genesis-missions-v6.clar +80 -0
- package/smart-contracts/contracts/genesis-missions-v8.clar +81 -0
- package/smart-contracts/contracts/genesis-missions-v9.clar +73 -0
- package/smart-contracts/contracts/genesis-missions.clar +68 -0
- package/smart-contracts/contracts/mission-mini-001.clar +32 -0
- package/smart-contracts/contracts/mission-mini-002.clar +42 -0
- package/smart-contracts/contracts/mission-mini-003.clar +39 -0
- package/smart-contracts/contracts/mission-mini-004.clar +39 -0
- package/smart-contracts/contracts/mission-mini-005.clar +36 -0
- package/smart-contracts/contracts/modules/genesis-badge-lite-v1.clar +17 -0
- package/smart-contracts/contracts/modules/genesis-counter-v1.clar +21 -0
- package/smart-contracts/contracts/modules/genesis-duel-v1.clar +16 -0
- package/smart-contracts/contracts/modules/genesis-flag-v1.clar +21 -0
- package/smart-contracts/contracts/modules/genesis-leaderboard-v1.clar +88 -0
- package/smart-contracts/contracts/modules/genesis-lucky-v1.clar +16 -0
- package/smart-contracts/contracts/modules/genesis-points-v1.clar +21 -0
- package/smart-contracts/contracts/modules/genesis-predict-v1.clar +14 -0
- package/smart-contracts/contracts/modules/genesis-score-lite-v1.clar +21 -0
- package/smart-contracts/contracts/modules/module-1.clar +2 -0
- package/smart-contracts/contracts/modules/module-10.clar +2 -0
- package/smart-contracts/contracts/modules/module-100.clar +2 -0
- package/smart-contracts/contracts/modules/module-101.clar +2 -0
- package/smart-contracts/contracts/modules/module-102.clar +2 -0
- package/smart-contracts/contracts/modules/module-103.clar +2 -0
- package/smart-contracts/contracts/modules/module-104.clar +2 -0
- package/smart-contracts/contracts/modules/module-105.clar +2 -0
- package/smart-contracts/contracts/modules/module-106.clar +2 -0
- package/smart-contracts/contracts/modules/module-107.clar +2 -0
- package/smart-contracts/contracts/modules/module-108.clar +2 -0
- package/smart-contracts/contracts/modules/module-109.clar +2 -0
- package/smart-contracts/contracts/modules/module-11.clar +2 -0
- package/smart-contracts/contracts/modules/module-110.clar +2 -0
- package/smart-contracts/contracts/modules/module-111.clar +2 -0
- package/smart-contracts/contracts/modules/module-112.clar +2 -0
- package/smart-contracts/contracts/modules/module-113.clar +2 -0
- package/smart-contracts/contracts/modules/module-114.clar +2 -0
- package/smart-contracts/contracts/modules/module-115.clar +2 -0
- package/smart-contracts/contracts/modules/module-116.clar +2 -0
- package/smart-contracts/contracts/modules/module-117.clar +2 -0
- package/smart-contracts/contracts/modules/module-118.clar +2 -0
- package/smart-contracts/contracts/modules/module-119.clar +2 -0
- package/smart-contracts/contracts/modules/module-12.clar +2 -0
- package/smart-contracts/contracts/modules/module-120.clar +2 -0
- package/smart-contracts/contracts/modules/module-121.clar +2 -0
- package/smart-contracts/contracts/modules/module-122.clar +2 -0
- package/smart-contracts/contracts/modules/module-123.clar +2 -0
- package/smart-contracts/contracts/modules/module-124.clar +2 -0
- package/smart-contracts/contracts/modules/module-125.clar +2 -0
- package/smart-contracts/contracts/modules/module-126.clar +2 -0
- package/smart-contracts/contracts/modules/module-127.clar +2 -0
- package/smart-contracts/contracts/modules/module-128.clar +2 -0
- package/smart-contracts/contracts/modules/module-129.clar +2 -0
- package/smart-contracts/contracts/modules/module-13.clar +2 -0
- package/smart-contracts/contracts/modules/module-130.clar +2 -0
- package/smart-contracts/contracts/modules/module-131.clar +2 -0
- package/smart-contracts/contracts/modules/module-132.clar +2 -0
- package/smart-contracts/contracts/modules/module-133.clar +2 -0
- package/smart-contracts/contracts/modules/module-134.clar +2 -0
- package/smart-contracts/contracts/modules/module-135.clar +2 -0
- package/smart-contracts/contracts/modules/module-136.clar +2 -0
- package/smart-contracts/contracts/modules/module-137.clar +2 -0
- package/smart-contracts/contracts/modules/module-138.clar +2 -0
- package/smart-contracts/contracts/modules/module-14.clar +2 -0
- package/smart-contracts/contracts/modules/module-140.clar +2 -0
- package/smart-contracts/contracts/modules/module-141.clar +2 -0
- package/smart-contracts/contracts/modules/module-142.clar +2 -0
- package/smart-contracts/contracts/modules/module-143.clar +2 -0
- package/smart-contracts/contracts/modules/module-144.clar +2 -0
- package/smart-contracts/contracts/modules/module-145.clar +2 -0
- package/smart-contracts/contracts/modules/module-146.clar +2 -0
- package/smart-contracts/contracts/modules/module-147.clar +2 -0
- package/smart-contracts/contracts/modules/module-148.clar +2 -0
- package/smart-contracts/contracts/modules/module-149.clar +2 -0
- package/smart-contracts/contracts/modules/module-15.clar +2 -0
- package/smart-contracts/contracts/modules/module-150.clar +2 -0
- package/smart-contracts/contracts/modules/module-152.clar +2 -0
- package/smart-contracts/contracts/modules/module-153.clar +2 -0
- package/smart-contracts/contracts/modules/module-154.clar +2 -0
- package/smart-contracts/contracts/modules/module-156.clar +2 -0
- package/smart-contracts/contracts/modules/module-157.clar +2 -0
- package/smart-contracts/contracts/modules/module-158.clar +2 -0
- package/smart-contracts/contracts/modules/module-159.clar +2 -0
- package/smart-contracts/contracts/modules/module-16.clar +2 -0
- package/smart-contracts/contracts/modules/module-160.clar +2 -0
- package/smart-contracts/contracts/modules/module-161.clar +2 -0
- package/smart-contracts/contracts/modules/module-162.clar +2 -0
- package/smart-contracts/contracts/modules/module-163.clar +2 -0
- package/smart-contracts/contracts/modules/module-164.clar +2 -0
- package/smart-contracts/contracts/modules/module-165.clar +2 -0
- package/smart-contracts/contracts/modules/module-166.clar +2 -0
- package/smart-contracts/contracts/modules/module-167.clar +2 -0
- package/smart-contracts/contracts/modules/module-168.clar +2 -0
- package/smart-contracts/contracts/modules/module-169.clar +2 -0
- package/smart-contracts/contracts/modules/module-17.clar +2 -0
- package/smart-contracts/contracts/modules/module-171.clar +2 -0
- package/smart-contracts/contracts/modules/module-172.clar +2 -0
- package/smart-contracts/contracts/modules/module-173.clar +2 -0
- package/smart-contracts/contracts/modules/module-174.clar +2 -0
- package/smart-contracts/contracts/modules/module-175.clar +2 -0
- package/smart-contracts/contracts/modules/module-176.clar +2 -0
- package/smart-contracts/contracts/modules/module-178.clar +2 -0
- package/smart-contracts/contracts/modules/module-179.clar +2 -0
- package/smart-contracts/contracts/modules/module-18.clar +2 -0
- package/smart-contracts/contracts/modules/module-180.clar +2 -0
- package/smart-contracts/contracts/modules/module-181.clar +2 -0
- package/smart-contracts/contracts/modules/module-182.clar +2 -0
- package/smart-contracts/contracts/modules/module-183.clar +2 -0
- package/smart-contracts/contracts/modules/module-184.clar +2 -0
- package/smart-contracts/contracts/modules/module-186.clar +2 -0
- package/smart-contracts/contracts/modules/module-188.clar +2 -0
- package/smart-contracts/contracts/modules/module-189.clar +2 -0
- package/smart-contracts/contracts/modules/module-19.clar +2 -0
- package/smart-contracts/contracts/modules/module-190.clar +2 -0
- package/smart-contracts/contracts/modules/module-191.clar +2 -0
- package/smart-contracts/contracts/modules/module-192.clar +2 -0
- package/smart-contracts/contracts/modules/module-193.clar +2 -0
- package/smart-contracts/contracts/modules/module-195.clar +2 -0
- package/smart-contracts/contracts/modules/module-196.clar +2 -0
- package/smart-contracts/contracts/modules/module-197.clar +2 -0
- package/smart-contracts/contracts/modules/module-198.clar +2 -0
- package/smart-contracts/contracts/modules/module-199.clar +2 -0
- package/smart-contracts/contracts/modules/module-2.clar +2 -0
- package/smart-contracts/contracts/modules/module-20.clar +2 -0
- package/smart-contracts/contracts/modules/module-200.clar +2 -0
- package/smart-contracts/contracts/modules/module-201.clar +2 -0
- package/smart-contracts/contracts/modules/module-202.clar +2 -0
- package/smart-contracts/contracts/modules/module-203.clar +2 -0
- package/smart-contracts/contracts/modules/module-204.clar +2 -0
- package/smart-contracts/contracts/modules/module-205.clar +2 -0
- package/smart-contracts/contracts/modules/module-207.clar +2 -0
- package/smart-contracts/contracts/modules/module-209.clar +2 -0
- package/smart-contracts/contracts/modules/module-21.clar +2 -0
- package/smart-contracts/contracts/modules/module-210.clar +2 -0
- package/smart-contracts/contracts/modules/module-212.clar +2 -0
- package/smart-contracts/contracts/modules/module-213.clar +2 -0
- package/smart-contracts/contracts/modules/module-215.clar +2 -0
- package/smart-contracts/contracts/modules/module-216.clar +2 -0
- package/smart-contracts/contracts/modules/module-218.clar +2 -0
- package/smart-contracts/contracts/modules/module-219.clar +2 -0
- package/smart-contracts/contracts/modules/module-22.clar +2 -0
- package/smart-contracts/contracts/modules/module-222.clar +2 -0
- package/smart-contracts/contracts/modules/module-223.clar +2 -0
- package/smart-contracts/contracts/modules/module-224.clar +2 -0
- package/smart-contracts/contracts/modules/module-226.clar +2 -0
- package/smart-contracts/contracts/modules/module-227.clar +2 -0
- package/smart-contracts/contracts/modules/module-228.clar +2 -0
- package/smart-contracts/contracts/modules/module-23.clar +2 -0
- package/smart-contracts/contracts/modules/module-230.clar +2 -0
- package/smart-contracts/contracts/modules/module-231.clar +2 -0
- package/smart-contracts/contracts/modules/module-232.clar +2 -0
- package/smart-contracts/contracts/modules/module-234.clar +2 -0
- package/smart-contracts/contracts/modules/module-235.clar +2 -0
- package/smart-contracts/contracts/modules/module-24.clar +2 -0
- package/smart-contracts/contracts/modules/module-241.clar +2 -0
- package/smart-contracts/contracts/modules/module-243.clar +2 -0
- package/smart-contracts/contracts/modules/module-244.clar +2 -0
- package/smart-contracts/contracts/modules/module-245.clar +2 -0
- package/smart-contracts/contracts/modules/module-246.clar +2 -0
- package/smart-contracts/contracts/modules/module-247.clar +2 -0
- package/smart-contracts/contracts/modules/module-25.clar +2 -0
- package/smart-contracts/contracts/modules/module-251.clar +2 -0
- package/smart-contracts/contracts/modules/module-252.clar +2 -0
- package/smart-contracts/contracts/modules/module-253.clar +2 -0
- package/smart-contracts/contracts/modules/module-254.clar +2 -0
- package/smart-contracts/contracts/modules/module-256.clar +2 -0
- package/smart-contracts/contracts/modules/module-257.clar +2 -0
- package/smart-contracts/contracts/modules/module-258.clar +2 -0
- package/smart-contracts/contracts/modules/module-26.clar +2 -0
- package/smart-contracts/contracts/modules/module-260.clar +2 -0
- package/smart-contracts/contracts/modules/module-262.clar +2 -0
- package/smart-contracts/contracts/modules/module-266.clar +2 -0
- package/smart-contracts/contracts/modules/module-267.clar +2 -0
- package/smart-contracts/contracts/modules/module-269.clar +2 -0
- package/smart-contracts/contracts/modules/module-27.clar +2 -0
- package/smart-contracts/contracts/modules/module-272.clar +2 -0
- package/smart-contracts/contracts/modules/module-275.clar +2 -0
- package/smart-contracts/contracts/modules/module-276.clar +2 -0
- package/smart-contracts/contracts/modules/module-277.clar +2 -0
- package/smart-contracts/contracts/modules/module-279.clar +2 -0
- package/smart-contracts/contracts/modules/module-28.clar +2 -0
- package/smart-contracts/contracts/modules/module-280.clar +2 -0
- package/smart-contracts/contracts/modules/module-282.clar +2 -0
- package/smart-contracts/contracts/modules/module-283.clar +2 -0
- package/smart-contracts/contracts/modules/module-286.clar +2 -0
- package/smart-contracts/contracts/modules/module-29.clar +2 -0
- package/smart-contracts/contracts/modules/module-291.clar +2 -0
- package/smart-contracts/contracts/modules/module-295.clar +2 -0
- package/smart-contracts/contracts/modules/module-296.clar +2 -0
- package/smart-contracts/contracts/modules/module-3.clar +2 -0
- package/smart-contracts/contracts/modules/module-30.clar +2 -0
- package/smart-contracts/contracts/modules/module-31.clar +2 -0
- package/smart-contracts/contracts/modules/module-32.clar +2 -0
- package/smart-contracts/contracts/modules/module-33.clar +2 -0
- package/smart-contracts/contracts/modules/module-34.clar +2 -0
- package/smart-contracts/contracts/modules/module-35.clar +2 -0
- package/smart-contracts/contracts/modules/module-36.clar +2 -0
- package/smart-contracts/contracts/modules/module-37.clar +2 -0
- package/smart-contracts/contracts/modules/module-38.clar +2 -0
- package/smart-contracts/contracts/modules/module-39.clar +2 -0
- package/smart-contracts/contracts/modules/module-4.clar +2 -0
- package/smart-contracts/contracts/modules/module-40.clar +2 -0
- package/smart-contracts/contracts/modules/module-41.clar +2 -0
- package/smart-contracts/contracts/modules/module-42.clar +2 -0
- package/smart-contracts/contracts/modules/module-43.clar +2 -0
- package/smart-contracts/contracts/modules/module-44.clar +2 -0
- package/smart-contracts/contracts/modules/module-45.clar +2 -0
- package/smart-contracts/contracts/modules/module-46.clar +2 -0
- package/smart-contracts/contracts/modules/module-47.clar +2 -0
- package/smart-contracts/contracts/modules/module-48.clar +2 -0
- package/smart-contracts/contracts/modules/module-49.clar +2 -0
- package/smart-contracts/contracts/modules/module-5.clar +2 -0
- package/smart-contracts/contracts/modules/module-50.clar +2 -0
- package/smart-contracts/contracts/modules/module-51.clar +2 -0
- package/smart-contracts/contracts/modules/module-52.clar +2 -0
- package/smart-contracts/contracts/modules/module-53.clar +2 -0
- package/smart-contracts/contracts/modules/module-54.clar +2 -0
- package/smart-contracts/contracts/modules/module-55.clar +2 -0
- package/smart-contracts/contracts/modules/module-56.clar +2 -0
- package/smart-contracts/contracts/modules/module-57.clar +2 -0
- package/smart-contracts/contracts/modules/module-58.clar +2 -0
- package/smart-contracts/contracts/modules/module-59.clar +2 -0
- package/smart-contracts/contracts/modules/module-6.clar +2 -0
- package/smart-contracts/contracts/modules/module-60.clar +2 -0
- package/smart-contracts/contracts/modules/module-61.clar +2 -0
- package/smart-contracts/contracts/modules/module-62.clar +2 -0
- package/smart-contracts/contracts/modules/module-63.clar +2 -0
- package/smart-contracts/contracts/modules/module-64.clar +2 -0
- package/smart-contracts/contracts/modules/module-65.clar +2 -0
- package/smart-contracts/contracts/modules/module-66.clar +2 -0
- package/smart-contracts/contracts/modules/module-67.clar +2 -0
- package/smart-contracts/contracts/modules/module-68.clar +2 -0
- package/smart-contracts/contracts/modules/module-69.clar +2 -0
- package/smart-contracts/contracts/modules/module-7.clar +2 -0
- package/smart-contracts/contracts/modules/module-70.clar +2 -0
- package/smart-contracts/contracts/modules/module-71.clar +2 -0
- package/smart-contracts/contracts/modules/module-72.clar +2 -0
- package/smart-contracts/contracts/modules/module-73.clar +2 -0
- package/smart-contracts/contracts/modules/module-74.clar +2 -0
- package/smart-contracts/contracts/modules/module-75.clar +2 -0
- package/smart-contracts/contracts/modules/module-76.clar +2 -0
- package/smart-contracts/contracts/modules/module-77.clar +2 -0
- package/smart-contracts/contracts/modules/module-78.clar +2 -0
- package/smart-contracts/contracts/modules/module-79.clar +2 -0
- package/smart-contracts/contracts/modules/module-8.clar +2 -0
- package/smart-contracts/contracts/modules/module-80.clar +2 -0
- package/smart-contracts/contracts/modules/module-81.clar +2 -0
- package/smart-contracts/contracts/modules/module-82.clar +2 -0
- package/smart-contracts/contracts/modules/module-83.clar +2 -0
- package/smart-contracts/contracts/modules/module-84.clar +2 -0
- package/smart-contracts/contracts/modules/module-85.clar +2 -0
- package/smart-contracts/contracts/modules/module-86.clar +2 -0
- package/smart-contracts/contracts/modules/module-87.clar +2 -0
- package/smart-contracts/contracts/modules/module-88.clar +2 -0
- package/smart-contracts/contracts/modules/module-89.clar +2 -0
- package/smart-contracts/contracts/modules/module-9.clar +2 -0
- package/smart-contracts/contracts/modules/module-90.clar +2 -0
- package/smart-contracts/contracts/modules/module-91.clar +2 -0
- package/smart-contracts/contracts/modules/module-92.clar +2 -0
- package/smart-contracts/contracts/modules/module-93.clar +2 -0
- package/smart-contracts/contracts/modules/module-94.clar +2 -0
- package/smart-contracts/contracts/modules/module-95.clar +2 -0
- package/smart-contracts/contracts/modules/module-96.clar +2 -0
- package/smart-contracts/contracts/modules/module-97.clar +2 -0
- package/smart-contracts/contracts/modules/module-98.clar +2 -0
- package/smart-contracts/contracts/modules/module-99.clar +2 -0
- package/smart-contracts/contracts/reputation-engine.clar +131 -0
- package/smart-contracts/contracts/sip-010-trait.clar +38 -0
- package/smart-contracts/contracts/staking-refinery-v3.clar +138 -0
- package/smart-contracts/contracts/staking-refinery-v4.clar +125 -0
- package/smart-contracts/contracts/staking-refinery-v5.clar +153 -0
- package/smart-contracts/contracts/staking-refinery-v6.clar +122 -0
- package/smart-contracts/contracts/staking-refinery-v7.clar +144 -0
- package/smart-contracts/contracts/staking-refinery.clar +80 -0
- package/smart-contracts/contracts/token-one-v3.clar +74 -0
- package/smart-contracts/contracts/token-one-v4.clar +51 -0
- package/smart-contracts/contracts/token-one-v5.clar +78 -0
- package/smart-contracts/contracts/token-one-v6.clar +91 -0
- package/smart-contracts/contracts/token-one-v7.clar +79 -0
- package/smart-contracts/contracts/token-one.clar +86 -0
- package/smart-contracts/contracts/token-poin-trait.clar +35 -0
- package/smart-contracts/contracts/token-poin-v3.clar +87 -0
- package/smart-contracts/contracts/token-poin-v4.clar +72 -0
- package/smart-contracts/contracts/token-poin-v5.clar +68 -0
- package/smart-contracts/contracts/token-poin-v6.clar +61 -0
- package/smart-contracts/contracts/token-poin-v7.clar +55 -0
- package/smart-contracts/contracts/token-poin.clar +85 -0
- package/smart-contracts/contracts/utility-gacha.clar +69 -0
- package/smart-contracts/deployments/default.mainnet-plan.yaml +18 -0
- package/smart-contracts/mission-mini-001.clar +0 -0
- package/smart-contracts/mission-mini-002.clar +0 -0
- package/smart-contracts/mission-mini-003.clar +0 -0
- package/smart-contracts/mission-mini-004.clar +0 -0
- package/smart-contracts/mission-mini-005.clar +0 -0
- package/smart-contracts/package-lock.json +2990 -0
- package/smart-contracts/package.json +24 -0
- package/smart-contracts/scripts/interact-modules.ts +1 -0
- package/smart-contracts/settings/Devnet.toml +155 -0
- package/smart-contracts/tests/genesis-badges.test.ts +21 -0
- package/smart-contracts/tests/genesis-core.test.ts +21 -0
- package/smart-contracts/tests/genesis-missions.test.ts +21 -0
- package/smart-contracts/tests/interact-reputation.ts +8 -0
- package/smart-contracts/tests/reputation-engine.test.ts +41 -0
- package/smart-contracts/tests/reputation.test.ts +15 -0
- package/smart-contracts/tests/token-one.test.ts +102 -0
- package/smart-contracts/tsconfig.json +26 -0
- package/smart-contracts/vitest.config.js +42 -0
- package/src/App.css +42 -0
- package/src/App.jsx +357 -0
- package/src/assets/react.svg +1 -0
- package/src/components/Layout.jsx +114 -0
- package/src/helper.js +153 -0
- package/src/index.css +21 -0
- package/src/main.jsx +160 -0
- package/src/pages/Gaming.jsx +177 -0
- package/src/pages/Home.jsx +153 -0
- package/src/pages/LeaderboardCard.tsx +93 -0
- package/src/pages/Profile.jsx +299 -0
- package/src/pages/Tasks.jsx +128 -0
- package/src/pages/Vault.jsx +524 -0
- package/src/polyfills.js +126 -0
- package/src/supabaseClient.js +141 -0
- package/src/utils.js +166 -0
- package/tailwind.config.js +42 -0
- package/temp-log.txt +4 -0
- package/vercel.json +8 -0
- package/vite.config.js +34 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
;; genesis-badges.clar
|
|
2
|
+
;; Standar SIP-009 NFT untuk Genesis Platform
|
|
3
|
+
;; Network: Stacks Mainnet
|
|
4
|
+
|
|
5
|
+
(impl-trait 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait.nft-trait)
|
|
6
|
+
|
|
7
|
+
(define-non-fungible-token genesis-badge uint)
|
|
8
|
+
|
|
9
|
+
;; Error Codes
|
|
10
|
+
(define-constant err-owner-only (err u100))
|
|
11
|
+
(define-constant err-not-token-owner (err u101))
|
|
12
|
+
(define-constant err-not-authorized (err u102))
|
|
13
|
+
|
|
14
|
+
;; Data Vars
|
|
15
|
+
(define-data-var last-token-id uint u0)
|
|
16
|
+
(define-data-var game-core-address principal tx-sender)
|
|
17
|
+
|
|
18
|
+
;; Mapping Metadata
|
|
19
|
+
(define-map token-uri uint (string-ascii 256))
|
|
20
|
+
|
|
21
|
+
;; --- SIP-009 STANDARD FUNCTIONS ---
|
|
22
|
+
|
|
23
|
+
(define-read-only (get-last-token-id)
|
|
24
|
+
(ok (var-get last-token-id))
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
(define-read-only (get-token-uri (token-id uint))
|
|
28
|
+
(ok (map-get? token-uri token-id))
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
(define-read-only (get-owner (token-id uint))
|
|
32
|
+
(ok (nft-get-owner? genesis-badge token-id))
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
(define-public (transfer (token-id uint) (sender principal) (recipient principal))
|
|
36
|
+
(begin
|
|
37
|
+
(asserts! (is-eq tx-sender sender) err-not-token-owner)
|
|
38
|
+
(nft-transfer? genesis-badge token-id sender recipient)
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
;; --- ADMINISTRATIVE FUNCTIONS ---
|
|
43
|
+
|
|
44
|
+
(define-public (set-game-core (new-core principal))
|
|
45
|
+
(begin
|
|
46
|
+
(asserts! (is-eq tx-sender (var-get game-core-address)) err-owner-only)
|
|
47
|
+
(var-set game-core-address new-core)
|
|
48
|
+
(ok true)
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
;; --- CORE FUNCTIONS ---
|
|
53
|
+
|
|
54
|
+
(define-public (mint-badge (recipient principal) (uri (string-ascii 256)))
|
|
55
|
+
(let
|
|
56
|
+
(
|
|
57
|
+
(token-id (+ (var-get last-token-id) u1))
|
|
58
|
+
)
|
|
59
|
+
;; Hanya Game Core yang boleh mint
|
|
60
|
+
(asserts! (is-eq tx-sender (var-get game-core-address)) err-not-authorized)
|
|
61
|
+
|
|
62
|
+
(try! (nft-mint? genesis-badge token-id recipient))
|
|
63
|
+
(map-set token-uri token-id uri)
|
|
64
|
+
(var-set last-token-id token-id)
|
|
65
|
+
(ok token-id)
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
(define-public (ping-68)
|
|
70
|
+
(ok true))
|
|
71
|
+
|
|
72
|
+
(define-public (ping-69)
|
|
73
|
+
(ok true))
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
;; ===============================
|
|
2
|
+
;; GENESIS BOOST V1
|
|
3
|
+
;; Modular XP Lock System
|
|
4
|
+
;; ===============================
|
|
5
|
+
|
|
6
|
+
(define-map locked-xp
|
|
7
|
+
principal
|
|
8
|
+
uint
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
(define-map boost-level
|
|
12
|
+
principal
|
|
13
|
+
uint
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
(define-read-only (get-locked (user principal))
|
|
17
|
+
(default-to u0 (map-get? locked-xp user))
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
(define-read-only (get-boost (user principal))
|
|
21
|
+
(default-to u0 (map-get? boost-level user))
|
|
22
|
+
)
|
|
23
|
+
(print { event: "score-update", user: tx-sender })
|
|
24
|
+
|
|
25
|
+
;; Lock XP (simulated)
|
|
26
|
+
(define-public (lock-xp (amount uint))
|
|
27
|
+
(let (
|
|
28
|
+
(current (default-to u0 (map-get? locked-xp tx-sender)))
|
|
29
|
+
)
|
|
30
|
+
(map-set locked-xp tx-sender (+ current amount))
|
|
31
|
+
(map-set boost-level tx-sender (+ u1 (/ amount u100)))
|
|
32
|
+
(ok true)
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
;; Unlock XP
|
|
37
|
+
(define-public (unlock-xp)
|
|
38
|
+
(begin
|
|
39
|
+
(map-delete locked-xp tx-sender)
|
|
40
|
+
(map-delete boost-level tx-sender)
|
|
41
|
+
(ok true)
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
(define-public (ping-87)
|
|
46
|
+
(ok true))
|
|
47
|
+
|
|
48
|
+
(define-public (ping-81)
|
|
49
|
+
(ok true))
|
|
50
|
+
|
|
51
|
+
(define-public (ping-104)
|
|
52
|
+
(ok true))
|
|
53
|
+
|
|
54
|
+
(define-public (ping-42)
|
|
55
|
+
(ok true))
|
|
56
|
+
|
|
57
|
+
(define-public (ping-279)
|
|
58
|
+
(ok true))
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
;; genesis-core-v10.clar
|
|
2
|
+
(define-constant err-admin-only (err u100))
|
|
3
|
+
(define-constant err-badge-exists (err u101))
|
|
4
|
+
(define-constant err-badge-not-found (err u102))
|
|
5
|
+
(define-constant err-req-xp (err u601))
|
|
6
|
+
(define-constant err-req-level (err u602))
|
|
7
|
+
(define-constant err-req-prereq (err u603))
|
|
8
|
+
(define-constant err-already-owned (err u604))
|
|
9
|
+
|
|
10
|
+
(define-data-var admin principal tx-sender)
|
|
11
|
+
|
|
12
|
+
(define-map badge-registry (string-ascii 20) { uri: (string-ascii 256), min-xp: uint, min-level: uint, prereq: (optional (string-ascii 20)) })
|
|
13
|
+
(define-map user-profile principal { xp: uint, level: uint })
|
|
14
|
+
(define-map wallet-has-badge { user: principal, badge-name: (string-ascii 20) } bool)
|
|
15
|
+
|
|
16
|
+
(define-private (calculate-level (xp uint)) (+ (/ xp u500) u1))
|
|
17
|
+
|
|
18
|
+
(define-private (add-xp (user principal) (amount uint))
|
|
19
|
+
(let ((current-data (default-to { xp: u0, level: u1 } (map-get? user-profile user))))
|
|
20
|
+
(let ((new-xp (+ (get xp current-data) amount))
|
|
21
|
+
(new-level (calculate-level new-xp)))
|
|
22
|
+
(map-set user-profile user { xp: new-xp, level: new-level })
|
|
23
|
+
(ok new-xp))))
|
|
24
|
+
|
|
25
|
+
(define-public (create-badge (name (string-ascii 20)) (uri (string-ascii 256)) (xp-req uint) (level-req uint) (prereq-badge (optional (string-ascii 20))))
|
|
26
|
+
(begin
|
|
27
|
+
(asserts! (is-eq tx-sender (var-get admin)) err-admin-only)
|
|
28
|
+
(asserts! (is-none (map-get? badge-registry name)) err-badge-exists)
|
|
29
|
+
(map-set badge-registry name { uri: uri, min-xp: xp-req, min-level: level-req, prereq: prereq-badge })
|
|
30
|
+
(ok true)))
|
|
31
|
+
|
|
32
|
+
(define-public (daily-check-in)
|
|
33
|
+
(let ((sender tx-sender)
|
|
34
|
+
(reward-response (as-contract (contract-call? .genesis-missions-v10 record-check-in sender))))
|
|
35
|
+
(match reward-response
|
|
36
|
+
reward-amount (add-xp sender reward-amount)
|
|
37
|
+
err-code (err err-code))))
|
|
38
|
+
|
|
39
|
+
(define-public (complete-mission (task-id uint) (reward uint))
|
|
40
|
+
(let ((sender tx-sender)
|
|
41
|
+
(mission-response (as-contract (contract-call? .genesis-missions-v10 record-task sender task-id reward))))
|
|
42
|
+
(match mission-response
|
|
43
|
+
approved-reward (add-xp sender approved-reward)
|
|
44
|
+
err-code (err err-code))))
|
|
45
|
+
|
|
46
|
+
(define-public (claim-badge (badge-name (string-ascii 20)))
|
|
47
|
+
(let ((sender tx-sender)
|
|
48
|
+
(badge-rules (unwrap! (map-get? badge-registry badge-name) err-badge-not-found))
|
|
49
|
+
(user-data (default-to { xp: u0, level: u1 } (map-get? user-profile sender))))
|
|
50
|
+
(let ((badge-uri (get uri badge-rules))
|
|
51
|
+
(required-prereq (get prereq badge-rules)))
|
|
52
|
+
|
|
53
|
+
(asserts! (not (default-to false (map-get? wallet-has-badge { user: sender, badge-name: badge-name }))) err-already-owned)
|
|
54
|
+
(asserts! (>= (get xp user-data) (get min-xp badge-rules)) err-req-xp)
|
|
55
|
+
(asserts! (>= (get level user-data) (get min-level badge-rules)) err-req-level)
|
|
56
|
+
|
|
57
|
+
(match required-prereq
|
|
58
|
+
prereq-name (asserts! (default-to false (map-get? wallet-has-badge { user: sender, badge-name: prereq-name })) err-req-prereq)
|
|
59
|
+
true)
|
|
60
|
+
|
|
61
|
+
(try! (as-contract (contract-call? .genesis-badges-v10 mint-badge sender badge-uri)))
|
|
62
|
+
(map-set wallet-has-badge { user: sender, badge-name: badge-name } true)
|
|
63
|
+
(ok true))))
|
|
64
|
+
|
|
65
|
+
(define-public (ping-74)
|
|
66
|
+
(ok true))
|
|
67
|
+
|
|
68
|
+
(define-public (ping-80)
|
|
69
|
+
(ok true))
|
|
70
|
+
|
|
71
|
+
(define-public (ping-118)
|
|
72
|
+
(ok true))
|
|
73
|
+
|
|
74
|
+
(define-public (ping-129)
|
|
75
|
+
(ok true))
|
|
76
|
+
|
|
77
|
+
(define-public (ping-102)
|
|
78
|
+
(ok true))
|
|
79
|
+
|
|
80
|
+
(define-public (ping-182)
|
|
81
|
+
(ok true))
|
|
82
|
+
|
|
83
|
+
(define-public (ping-13)
|
|
84
|
+
(ok true))
|
|
85
|
+
|
|
86
|
+
(define-public (ping-257)
|
|
87
|
+
(ok true))
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
;; genesis-core-v2.clar
|
|
2
|
+
;; Fixed Version: Hardcoded Contract Calls to prevent VM Error
|
|
3
|
+
|
|
4
|
+
(define-constant URI_GENESIS "ipfs://QmYourGenesisHash/genesis.json")
|
|
5
|
+
(define-constant URI_NODE "ipfs://QmYourNodeHash/node.json")
|
|
6
|
+
(define-constant URI_GUARDIAN "ipfs://QmYourGuardianHash/guardian.json")
|
|
7
|
+
|
|
8
|
+
(define-constant err-admin-only (err u100))
|
|
9
|
+
(define-constant err-badge-exists (err u101))
|
|
10
|
+
(define-constant err-badge-not-found (err u102))
|
|
11
|
+
(define-constant err-req-xp (err u601))
|
|
12
|
+
(define-constant err-req-level (err u602))
|
|
13
|
+
(define-constant err-req-prereq (err u603))
|
|
14
|
+
(define-constant err-already-owned (err u604))
|
|
15
|
+
|
|
16
|
+
(define-data-var admin principal tx-sender)
|
|
17
|
+
|
|
18
|
+
(define-map badge-registry (string-ascii 20) { uri: (string-ascii 256), min-xp: uint, min-level: uint, prereq: (optional (string-ascii 20)) })
|
|
19
|
+
(define-map user-profile principal { xp: uint, level: uint })
|
|
20
|
+
(define-map wallet-has-badge { user: principal, badge-name: (string-ascii 20) } bool)
|
|
21
|
+
|
|
22
|
+
(define-private (calculate-level (xp uint)) (+ (/ xp u500) u1))
|
|
23
|
+
|
|
24
|
+
(define-private (add-xp (user principal) (amount uint))
|
|
25
|
+
(let ((current-data (default-to { xp: u0, level: u1 } (map-get? user-profile user))))
|
|
26
|
+
(let ((new-xp (+ (get xp current-data) amount)) (new-level (calculate-level new-xp)))
|
|
27
|
+
(map-set user-profile user { xp: new-xp, level: new-level })
|
|
28
|
+
(ok new-xp))))
|
|
29
|
+
|
|
30
|
+
(define-public (create-badge (name (string-ascii 20)) (uri (string-ascii 256)) (xp-req uint) (level-req uint) (prereq-badge (optional (string-ascii 20))))
|
|
31
|
+
(begin
|
|
32
|
+
(asserts! (is-eq tx-sender (var-get admin)) err-admin-only)
|
|
33
|
+
(asserts! (is-none (map-get? badge-registry name)) err-badge-exists)
|
|
34
|
+
(map-set badge-registry name { uri: uri, min-xp: xp-req, min-level: level-req, prereq: prereq-badge })
|
|
35
|
+
(ok true)))
|
|
36
|
+
|
|
37
|
+
;; FIX: Panggil langsung alamat kontrak missions di sini
|
|
38
|
+
(define-public (daily-check-in)
|
|
39
|
+
(let ((sender tx-sender)
|
|
40
|
+
(reward-response (contract-call? 'SP3GHKMV4GSYNA8WGBX83DACG80K1RRVQZAZMB9J3.genesis-missions record-check-in sender)))
|
|
41
|
+
(match reward-response reward-amount (add-xp sender reward-amount) err-code (err err-code))))
|
|
42
|
+
|
|
43
|
+
;; FIX: Panggil langsung alamat kontrak missions di sini
|
|
44
|
+
(define-public (complete-mission (task-id uint) (reward uint))
|
|
45
|
+
(let ((sender tx-sender)
|
|
46
|
+
(mission-response (contract-call? 'SP3GHKMV4GSYNA8WGBX83DACG80K1RRVQZAZMB9J3.genesis-missions record-task sender task-id reward)))
|
|
47
|
+
(match mission-response approved-reward (add-xp sender approved-reward) err-code (err err-code))))
|
|
48
|
+
|
|
49
|
+
(define-public (claim-badge (badge-name (string-ascii 20)))
|
|
50
|
+
(let ((sender tx-sender)
|
|
51
|
+
(badge-rules (unwrap! (map-get? badge-registry badge-name) err-badge-not-found))
|
|
52
|
+
(user-data (default-to { xp: u0, level: u1 } (map-get? user-profile sender))))
|
|
53
|
+
(let ((required-xp (get min-xp badge-rules)) (required-level (get min-level badge-rules)) (required-prereq (get prereq badge-rules)) (badge-uri (get uri badge-rules)))
|
|
54
|
+
|
|
55
|
+
(asserts! (not (default-to false (map-get? wallet-has-badge { user: sender, badge-name: badge-name }))) err-already-owned)
|
|
56
|
+
|
|
57
|
+
(asserts! (>= (get xp user-data) required-xp) err-req-xp)
|
|
58
|
+
(asserts! (>= (get level user-data) required-level) err-req-level)
|
|
59
|
+
(match required-prereq prereq-name (asserts! (default-to false (map-get? wallet-has-badge { user: sender, badge-name: prereq-name })) err-req-prereq) true)
|
|
60
|
+
|
|
61
|
+
;; FIX: Panggil langsung alamat kontrak badges di sini
|
|
62
|
+
(try! (as-contract (contract-call? 'SP3GHKMV4GSYNA8WGBX83DACG80K1RRVQZAZMB9J3.genesis-badges mint-badge sender badge-uri)))
|
|
63
|
+
|
|
64
|
+
(map-set wallet-has-badge { user: sender, badge-name: badge-name } true)
|
|
65
|
+
(ok true))))
|
|
66
|
+
|
|
67
|
+
(define-public (ping-156)
|
|
68
|
+
(ok true))
|
|
69
|
+
|
|
70
|
+
(define-public (ping-78)
|
|
71
|
+
(ok true))
|
|
72
|
+
|
|
73
|
+
(define-public (ping-178)
|
|
74
|
+
(ok true))
|
|
75
|
+
|
|
76
|
+
(define-public (ping-194)
|
|
77
|
+
(ok true))
|
|
78
|
+
|
|
79
|
+
(define-public (ping-202)
|
|
80
|
+
(ok true))
|
|
81
|
+
|
|
82
|
+
(define-public (ping-238)
|
|
83
|
+
(ok true))
|
|
84
|
+
|
|
85
|
+
(define-public (ping-41)
|
|
86
|
+
(ok true))
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
;; genesis-core-v4.clar
|
|
2
|
+
;; FINAL VERSION: Pointing to V4 Contracts
|
|
3
|
+
|
|
4
|
+
(define-constant URI_GENESIS "ipfs://QmYourGenesisHash/genesis.json")
|
|
5
|
+
(define-constant URI_NODE "ipfs://QmYourNodeHash/node.json")
|
|
6
|
+
(define-constant URI_GUARDIAN "ipfs://QmYourGuardianHash/guardian.json")
|
|
7
|
+
|
|
8
|
+
(define-constant err-admin-only (err u100))
|
|
9
|
+
(define-constant err-badge-exists (err u101))
|
|
10
|
+
(define-constant err-badge-not-found (err u102))
|
|
11
|
+
(define-constant err-req-xp (err u601))
|
|
12
|
+
(define-constant err-req-level (err u602))
|
|
13
|
+
(define-constant err-req-prereq (err u603))
|
|
14
|
+
(define-constant err-already-owned (err u604))
|
|
15
|
+
|
|
16
|
+
(define-data-var admin principal tx-sender)
|
|
17
|
+
|
|
18
|
+
(define-map badge-registry (string-ascii 20) { uri: (string-ascii 256), min-xp: uint, min-level: uint, prereq: (optional (string-ascii 20)) })
|
|
19
|
+
(define-map user-profile principal { xp: uint, level: uint })
|
|
20
|
+
(define-map wallet-has-badge { user: principal, badge-name: (string-ascii 20) } bool)
|
|
21
|
+
|
|
22
|
+
(define-private (calculate-level (xp uint)) (+ (/ xp u500) u1))
|
|
23
|
+
|
|
24
|
+
(define-private (add-xp (user principal) (amount uint))
|
|
25
|
+
(let ((current-data (default-to { xp: u0, level: u1 } (map-get? user-profile user))))
|
|
26
|
+
(let ((new-xp (+ (get xp current-data) amount)) (new-level (calculate-level new-xp)))
|
|
27
|
+
(map-set user-profile user { xp: new-xp, level: new-level })
|
|
28
|
+
(ok new-xp))))
|
|
29
|
+
|
|
30
|
+
(define-public (create-badge (name (string-ascii 20)) (uri (string-ascii 256)) (xp-req uint) (level-req uint) (prereq-badge (optional (string-ascii 20))))
|
|
31
|
+
(begin
|
|
32
|
+
(asserts! (is-eq tx-sender (var-get admin)) err-admin-only)
|
|
33
|
+
(asserts! (is-none (map-get? badge-registry name)) err-badge-exists)
|
|
34
|
+
(map-set badge-registry name { uri: uri, min-xp: xp-req, min-level: level-req, prereq: prereq-badge })
|
|
35
|
+
(ok true)))
|
|
36
|
+
|
|
37
|
+
;; FIX: Panggil ke genesis-missions-v4 (HARUS V4)
|
|
38
|
+
(define-public (daily-check-in)
|
|
39
|
+
(let ((sender tx-sender)
|
|
40
|
+
(reward-response (as-contract (contract-call? 'SP3GHKMV4GSYNA8WGBX83DACG80K1RRVQZAZMB9J3.genesis-missions-v4 record-check-in sender))))
|
|
41
|
+
(match reward-response reward-amount (add-xp sender reward-amount) err-code (err err-code))))
|
|
42
|
+
|
|
43
|
+
;; FIX: Panggil ke genesis-missions-v4 (HARUS V4)
|
|
44
|
+
(define-public (complete-mission (task-id uint) (reward uint))
|
|
45
|
+
(let ((sender tx-sender)
|
|
46
|
+
(mission-response (as-contract (contract-call? 'SP3GHKMV4GSYNA8WGBX83DACG80K1RRVQZAZMB9J3.genesis-missions-v4 record-task sender task-id reward))))
|
|
47
|
+
(match mission-response approved-reward (add-xp sender approved-reward) err-code (err err-code))))
|
|
48
|
+
|
|
49
|
+
(define-public (claim-badge (badge-name (string-ascii 20)))
|
|
50
|
+
(let ((sender tx-sender)
|
|
51
|
+
(badge-rules (unwrap! (map-get? badge-registry badge-name) err-badge-not-found))
|
|
52
|
+
(user-data (default-to { xp: u0, level: u1 } (map-get? user-profile sender))))
|
|
53
|
+
(let ((required-xp (get min-xp badge-rules)) (required-level (get min-level badge-rules)) (required-prereq (get prereq badge-rules)) (badge-uri (get uri badge-rules)))
|
|
54
|
+
|
|
55
|
+
(asserts! (not (default-to false (map-get? wallet-has-badge { user: sender, badge-name: badge-name }))) err-already-owned)
|
|
56
|
+
|
|
57
|
+
(asserts! (>= (get xp user-data) required-xp) err-req-xp)
|
|
58
|
+
(asserts! (>= (get level user-data) required-level) err-req-level)
|
|
59
|
+
(match required-prereq prereq-name (asserts! (default-to false (map-get? wallet-has-badge { user: sender, badge-name: prereq-name })) err-req-prereq) true)
|
|
60
|
+
|
|
61
|
+
;; FIX: Panggil ke genesis-badges-v4 (HARUS V4)
|
|
62
|
+
(try! (as-contract (contract-call? 'SP3GHKMV4GSYNA8WGBX83DACG80K1RRVQZAZMB9J3.genesis-badges-v4 mint-badge sender badge-uri)))
|
|
63
|
+
|
|
64
|
+
(map-set wallet-has-badge { user: sender, badge-name: badge-name } true)
|
|
65
|
+
(ok true))))
|
|
66
|
+
|
|
67
|
+
(define-public (ping-129)
|
|
68
|
+
(ok true))
|
|
69
|
+
|
|
70
|
+
(define-public (ping-32)
|
|
71
|
+
(ok true))
|
|
72
|
+
|
|
73
|
+
(define-public (ping-36)
|
|
74
|
+
(ok true))
|
|
75
|
+
|
|
76
|
+
(define-public (ping-22)
|
|
77
|
+
(ok true))
|
|
78
|
+
|
|
79
|
+
(define-public (ping-79)
|
|
80
|
+
(ok true))
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
;; genesis-core-v5.clar
|
|
2
|
+
;; Core Contract: Manages XP, Levels, and Badges
|
|
3
|
+
|
|
4
|
+
(define-constant URI_GENESIS "ipfs://QmYourGenesisHash/genesis.json")
|
|
5
|
+
(define-constant URI_NODE "ipfs://QmYourNodeHash/node.json")
|
|
6
|
+
(define-constant URI_GUARDIAN "ipfs://QmYourGuardianHash/guardian.json")
|
|
7
|
+
|
|
8
|
+
(define-constant err-admin-only (err u100))
|
|
9
|
+
(define-constant err-badge-exists (err u101))
|
|
10
|
+
(define-constant err-badge-not-found (err u102))
|
|
11
|
+
(define-constant err-req-xp (err u601))
|
|
12
|
+
(define-constant err-req-level (err u602))
|
|
13
|
+
(define-constant err-req-prereq (err u603))
|
|
14
|
+
(define-constant err-already-owned (err u604))
|
|
15
|
+
|
|
16
|
+
(define-data-var admin principal tx-sender)
|
|
17
|
+
|
|
18
|
+
(define-map badge-registry (string-ascii 20) { uri: (string-ascii 256), min-xp: uint, min-level: uint, prereq: (optional (string-ascii 20)) })
|
|
19
|
+
(define-map user-profile principal { xp: uint, level: uint })
|
|
20
|
+
(define-map wallet-has-badge { user: principal, badge-name: (string-ascii 20) } bool)
|
|
21
|
+
|
|
22
|
+
(define-private (calculate-level (xp uint)) (+ (/ xp u500) u1))
|
|
23
|
+
|
|
24
|
+
(define-private (add-xp (user principal) (amount uint))
|
|
25
|
+
(let ((current-data (default-to { xp: u0, level: u1 } (map-get? user-profile user))))
|
|
26
|
+
(let ((new-xp (+ (get xp current-data) amount)) (new-level (calculate-level new-xp)))
|
|
27
|
+
(map-set user-profile user { xp: new-xp, level: new-level })
|
|
28
|
+
(ok new-xp))))
|
|
29
|
+
|
|
30
|
+
(define-public (create-badge (name (string-ascii 20)) (uri (string-ascii 256)) (xp-req uint) (level-req uint) (prereq-badge (optional (string-ascii 20))))
|
|
31
|
+
(begin
|
|
32
|
+
(asserts! (is-eq tx-sender (var-get admin)) err-admin-only)
|
|
33
|
+
(asserts! (is-none (map-get? badge-registry name)) err-badge-exists)
|
|
34
|
+
(map-set badge-registry name { uri: uri, min-xp: xp-req, min-level: level-req, prereq: prereq-badge })
|
|
35
|
+
(ok true)))
|
|
36
|
+
|
|
37
|
+
;; FIX: Pointing to Local Contract v5
|
|
38
|
+
(define-public (daily-check-in)
|
|
39
|
+
(let ((sender tx-sender)
|
|
40
|
+
(reward-response (as-contract (contract-call? .genesis-missions-v5 record-check-in sender))))
|
|
41
|
+
(match reward-response reward-amount (add-xp sender reward-amount) err-code (err err-code))))
|
|
42
|
+
|
|
43
|
+
;; FIX: Pointing to Local Contract v5
|
|
44
|
+
(define-public (complete-mission (task-id uint) (reward uint))
|
|
45
|
+
(let ((sender tx-sender)
|
|
46
|
+
(mission-response (as-contract (contract-call? .genesis-missions-v5 record-task sender task-id reward))))
|
|
47
|
+
(match mission-response approved-reward (add-xp sender approved-reward) err-code (err err-code))))
|
|
48
|
+
|
|
49
|
+
(define-public (claim-badge (badge-name (string-ascii 20)))
|
|
50
|
+
(let ((sender tx-sender)
|
|
51
|
+
(badge-rules (unwrap! (map-get? badge-registry badge-name) err-badge-not-found))
|
|
52
|
+
(user-data (default-to { xp: u0, level: u1 } (map-get? user-profile sender))))
|
|
53
|
+
(let ((required-xp (get min-xp badge-rules)) (required-level (get min-level badge-rules)) (required-prereq (get prereq badge-rules)) (badge-uri (get uri badge-rules)))
|
|
54
|
+
|
|
55
|
+
(asserts! (not (default-to false (map-get? wallet-has-badge { user: sender, badge-name: badge-name }))) err-already-owned)
|
|
56
|
+
|
|
57
|
+
(asserts! (>= (get xp user-data) required-xp) err-req-xp)
|
|
58
|
+
(asserts! (>= (get level user-data) required-level) err-req-level)
|
|
59
|
+
(match required-prereq prereq-name (asserts! (default-to false (map-get? wallet-has-badge { user: sender, badge-name: prereq-name })) err-req-prereq) true)
|
|
60
|
+
|
|
61
|
+
;; Asumsi lu nggak mau deploy ulang genesis-badges, tetep pake v4
|
|
62
|
+
(try! (as-contract (contract-call? .genesis-badges-v4 mint-badge sender badge-uri)))
|
|
63
|
+
|
|
64
|
+
(map-set wallet-has-badge { user: sender, badge-name: badge-name } true)
|
|
65
|
+
(ok true))))
|
|
66
|
+
|
|
67
|
+
(define-public (ping-104)
|
|
68
|
+
(ok true))
|
|
69
|
+
|
|
70
|
+
(define-public (ping-63)
|
|
71
|
+
(ok true))
|
|
72
|
+
|
|
73
|
+
(define-public (ping-49)
|
|
74
|
+
(ok true))
|
|
75
|
+
|
|
76
|
+
(define-public (ping-60)
|
|
77
|
+
(ok true))
|
|
78
|
+
|
|
79
|
+
(define-public (ping-223)
|
|
80
|
+
(ok true))
|
|
81
|
+
|
|
82
|
+
(define-public (ping-3)
|
|
83
|
+
(ok true))
|
|
84
|
+
|
|
85
|
+
(define-public (ping-191)
|
|
86
|
+
(ok true))
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
;; genesis-core-v6.clar
|
|
2
|
+
;; Core Contract: Manages XP, Levels, and Badges (Updated to point to Badges v5)
|
|
3
|
+
|
|
4
|
+
(define-constant URI_GENESIS "ipfs://QmYourGenesisHash/genesis.json")
|
|
5
|
+
(define-constant URI_NODE "ipfs://QmYourNodeHash/node.json")
|
|
6
|
+
(define-constant URI_GUARDIAN "ipfs://QmYourGuardianHash/guardian.json")
|
|
7
|
+
|
|
8
|
+
(define-constant err-admin-only (err u100))
|
|
9
|
+
(define-constant err-badge-exists (err u101))
|
|
10
|
+
(define-constant err-badge-not-found (err u102))
|
|
11
|
+
(define-constant err-req-xp (err u601))
|
|
12
|
+
(define-constant err-req-level (err u602))
|
|
13
|
+
(define-constant err-req-prereq (err u603))
|
|
14
|
+
(define-constant err-already-owned (err u604))
|
|
15
|
+
|
|
16
|
+
(define-data-var admin principal tx-sender)
|
|
17
|
+
|
|
18
|
+
(define-map badge-registry (string-ascii 20) { uri: (string-ascii 256), min-xp: uint, min-level: uint, prereq: (optional (string-ascii 20)) })
|
|
19
|
+
(define-map user-profile principal { xp: uint, level: uint })
|
|
20
|
+
(define-map wallet-has-badge { user: principal, badge-name: (string-ascii 20) } bool)
|
|
21
|
+
|
|
22
|
+
(define-private (calculate-level (xp uint)) (+ (/ xp u500) u1))
|
|
23
|
+
|
|
24
|
+
(define-private (add-xp (user principal) (amount uint))
|
|
25
|
+
(let ((current-data (default-to { xp: u0, level: u1 } (map-get? user-profile user))))
|
|
26
|
+
(let ((new-xp (+ (get xp current-data) amount)) (new-level (calculate-level new-xp)))
|
|
27
|
+
(map-set user-profile user { xp: new-xp, level: new-level })
|
|
28
|
+
(ok new-xp))))
|
|
29
|
+
|
|
30
|
+
(define-public (create-badge (name (string-ascii 20)) (uri (string-ascii 256)) (xp-req uint) (level-req uint) (prereq-badge (optional (string-ascii 20))))
|
|
31
|
+
(begin
|
|
32
|
+
(asserts! (is-eq tx-sender (var-get admin)) err-admin-only)
|
|
33
|
+
(asserts! (is-none (map-get? badge-registry name)) err-badge-exists)
|
|
34
|
+
(map-set badge-registry name { uri: uri, min-xp: xp-req, min-level: level-req, prereq: prereq-badge })
|
|
35
|
+
(ok true)))
|
|
36
|
+
|
|
37
|
+
;; Pointing to genesis-missions-v5
|
|
38
|
+
(define-public (daily-check-in)
|
|
39
|
+
(let ((sender tx-sender)
|
|
40
|
+
(reward-response (as-contract (contract-call? .genesis-missions-v5 record-check-in sender))))
|
|
41
|
+
(match reward-response reward-amount (add-xp sender reward-amount) err-code (err err-code))))
|
|
42
|
+
|
|
43
|
+
;; Pointing to genesis-missions-v5
|
|
44
|
+
(define-public (complete-mission (task-id uint) (reward uint))
|
|
45
|
+
(let ((sender tx-sender)
|
|
46
|
+
(mission-response (as-contract (contract-call? .genesis-missions-v5 record-task sender task-id reward))))
|
|
47
|
+
(match mission-response approved-reward (add-xp sender approved-reward) err-code (err err-code))))
|
|
48
|
+
|
|
49
|
+
(define-public (claim-badge (badge-name (string-ascii 20)))
|
|
50
|
+
(let ((sender tx-sender)
|
|
51
|
+
(badge-rules (unwrap! (map-get? badge-registry badge-name) err-badge-not-found))
|
|
52
|
+
(user-data (default-to { xp: u0, level: u1 } (map-get? user-profile sender))))
|
|
53
|
+
(let ((required-xp (get min-xp badge-rules))
|
|
54
|
+
(required-level (get min-level badge-rules))
|
|
55
|
+
(required-prereq (get prereq badge-rules))
|
|
56
|
+
(badge-uri (get uri badge-rules)))
|
|
57
|
+
|
|
58
|
+
(asserts! (not (default-to false (map-get? wallet-has-badge { user: sender, badge-name: badge-name }))) err-already-owned)
|
|
59
|
+
|
|
60
|
+
(asserts! (>= (get xp user-data) required-xp) err-req-xp)
|
|
61
|
+
(asserts! (>= (get level user-data) required-level) err-req-level)
|
|
62
|
+
(match required-prereq prereq-name (asserts! (default-to false (map-get? wallet-has-badge { user: sender, badge-name: prereq-name })) err-req-prereq) true)
|
|
63
|
+
|
|
64
|
+
;; PERUBAHAN DI SINI: Memanggil genesis-badges-v5
|
|
65
|
+
(try! (as-contract (contract-call? .genesis-badges-v5 mint-badge sender badge-uri)))
|
|
66
|
+
|
|
67
|
+
(map-set wallet-has-badge { user: sender, badge-name: badge-name } true)
|
|
68
|
+
(ok true))))
|
|
69
|
+
|
|
70
|
+
(define-public (ping-28)
|
|
71
|
+
(ok true))
|
|
72
|
+
|
|
73
|
+
(define-public (ping-140)
|
|
74
|
+
(ok true))
|
|
75
|
+
|
|
76
|
+
(define-public (ping-112)
|
|
77
|
+
(ok true))
|
|
78
|
+
|
|
79
|
+
(define-public (ping-197)
|
|
80
|
+
(ok true))
|
|
81
|
+
|
|
82
|
+
(define-public (ping-91)
|
|
83
|
+
(ok true))
|
|
84
|
+
|
|
85
|
+
(define-public (ping-27)
|
|
86
|
+
(ok true))
|
|
87
|
+
|
|
88
|
+
(define-public (ping-11)
|
|
89
|
+
(ok true))
|
|
90
|
+
|
|
91
|
+
(define-public (ping-151)
|
|
92
|
+
(ok true))
|
|
93
|
+
|
|
94
|
+
(define-public (ping-232)
|
|
95
|
+
(ok true))
|
|
96
|
+
|
|
97
|
+
(define-public (ping-168)
|
|
98
|
+
(ok true))
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
;; genesis-core-v8.clar
|
|
2
|
+
;; Core Contract: XP, Levels, and Badges
|
|
3
|
+
;; Version: Clarity 1 Compatible
|
|
4
|
+
|
|
5
|
+
(define-constant err-admin-only (err u100))
|
|
6
|
+
(define-constant err-badge-exists (err u101))
|
|
7
|
+
(define-constant err-badge-not-found (err u102))
|
|
8
|
+
(define-constant err-req-xp (err u601))
|
|
9
|
+
(define-constant err-req-level (err u602))
|
|
10
|
+
(define-constant err-req-prereq (err u603))
|
|
11
|
+
(define-constant err-already-owned (err u604))
|
|
12
|
+
(define-constant err-not-authorized (err u100))
|
|
13
|
+
(define-constant err-invalid-input (err u101))
|
|
14
|
+
(define-constant err-insufficient-score (err u102))
|
|
15
|
+
|
|
16
|
+
(define-data-var admin principal tx-sender)
|
|
17
|
+
|
|
18
|
+
(define-map badge-registry (string-ascii 20) { uri: (string-ascii 256), min-xp: uint, min-level: uint, prereq: (optional (string-ascii 20)) })
|
|
19
|
+
(define-map user-profile principal { xp: uint, level: uint })
|
|
20
|
+
(define-map wallet-has-badge { user: principal, badge-name: (string-ascii 20) } bool)
|
|
21
|
+
|
|
22
|
+
(define-private (calculate-level (xp uint)) (+ (/ xp u500) u1))
|
|
23
|
+
|
|
24
|
+
(define-private (add-xp (user principal) (amount uint))
|
|
25
|
+
(let ((current-data (default-to { xp: u0, level: u1 } (map-get? user-profile user))))
|
|
26
|
+
(let ((new-xp (+ (get xp current-data) amount))
|
|
27
|
+
(new-level (calculate-level new-xp)))
|
|
28
|
+
(map-set user-profile user { xp: new-xp, level: new-level })
|
|
29
|
+
(ok new-xp))))
|
|
30
|
+
|
|
31
|
+
(define-public (create-badge (name (string-ascii 20)) (uri (string-ascii 256)) (xp-req uint) (level-req uint) (prereq-badge (optional (string-ascii 20))))
|
|
32
|
+
(begin
|
|
33
|
+
(asserts! (is-eq tx-sender (var-get admin)) err-admin-only)
|
|
34
|
+
(asserts! (is-none (map-get? badge-registry name)) err-badge-exists)
|
|
35
|
+
(map-set badge-registry name { uri: uri, min-xp: xp-req, min-level: level-req, prereq: prereq-badge })
|
|
36
|
+
(ok true)))
|
|
37
|
+
|
|
38
|
+
(define-public (daily-check-in)
|
|
39
|
+
(let ((sender tx-sender))
|
|
40
|
+
(let ((reward-response (as-contract (contract-call? .genesis-missions-v8 record-check-in sender))))
|
|
41
|
+
(match reward-response
|
|
42
|
+
reward-amount (add-xp sender reward-amount)
|
|
43
|
+
err-code (err err-code)))))
|
|
44
|
+
|
|
45
|
+
(define-public (complete-mission (task-id uint) (reward uint))
|
|
46
|
+
(let ((sender tx-sender))
|
|
47
|
+
(let ((mission-response (as-contract (contract-call? .genesis-missions-v8 record-task sender task-id reward))))
|
|
48
|
+
(match mission-response
|
|
49
|
+
approved-reward (add-xp sender approved-reward)
|
|
50
|
+
err-code (err err-code)))))
|
|
51
|
+
|
|
52
|
+
(define-public (claim-badge (badge-name (string-ascii 20)))
|
|
53
|
+
(let ((sender tx-sender)
|
|
54
|
+
(badge-rules (unwrap! (map-get? badge-registry badge-name) err-badge-not-found))
|
|
55
|
+
(user-data (default-to { xp: u0, level: u1 } (map-get? user-profile sender))))
|
|
56
|
+
(let ((required-xp (get min-xp badge-rules))
|
|
57
|
+
(required-level (get min-level badge-rules))
|
|
58
|
+
(required-prereq (get prereq badge-rules))
|
|
59
|
+
(badge-uri (get uri badge-rules)))
|
|
60
|
+
|
|
61
|
+
(asserts! (not (default-to false (map-get? wallet-has-badge { user: sender, badge-name: badge-name }))) err-already-owned)
|
|
62
|
+
(asserts! (>= (get xp user-data) required-xp) err-req-xp)
|
|
63
|
+
(asserts! (>= (get level user-data) required-level) err-req-level)
|
|
64
|
+
|
|
65
|
+
;; Match handling for Clarity 1 compatibility
|
|
66
|
+
(match required-prereq
|
|
67
|
+
prereq-name (asserts! (default-to false (map-get? wallet-has-badge { user: sender, badge-name: prereq-name })) err-req-prereq)
|
|
68
|
+
(ok true))
|
|
69
|
+
|
|
70
|
+
(try! (as-contract (contract-call? .genesis-badges-v8 mint-badge sender badge-uri)))
|
|
71
|
+
|
|
72
|
+
(map-set wallet-has-badge { user: sender, badge-name: badge-name } true)
|
|
73
|
+
(ok true))))
|
|
74
|
+
|
|
75
|
+
(define-public (ping-141)
|
|
76
|
+
(ok true))
|
|
77
|
+
|
|
78
|
+
(define-public (ping-21)
|
|
79
|
+
(ok true))
|
|
80
|
+
|
|
81
|
+
(define-public (ping-71)
|
|
82
|
+
(ok true))
|
|
83
|
+
|
|
84
|
+
(define-public (ping-18)
|
|
85
|
+
(ok true))
|
|
86
|
+
|
|
87
|
+
(define-public (ping-84)
|
|
88
|
+
(ok true))
|
|
89
|
+
|
|
90
|
+
(define-public (ping-105)
|
|
91
|
+
(ok true))
|
|
92
|
+
|
|
93
|
+
(define-public (ping-51)
|
|
94
|
+
(ok true))
|
|
95
|
+
|
|
96
|
+
(define-public (ping-137)
|
|
97
|
+
(ok true))
|
|
98
|
+
|
|
99
|
+
(define-public (ping-45)
|
|
100
|
+
(ok true))
|
|
101
|
+
|
|
102
|
+
(define-public (ping-167)
|
|
103
|
+
(ok true))
|
|
104
|
+
|
|
105
|
+
(define-public (ping-57)
|
|
106
|
+
(ok true))
|