@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,24 @@
|
|
|
1
|
+
|
|
2
|
+
{
|
|
3
|
+
"name": "smart-contracts-tests",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Run unit tests on this project.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"private": true,
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "vitest run",
|
|
10
|
+
"test:report": "vitest run -- --coverage --costs",
|
|
11
|
+
"test:watch": "chokidar \"tests/**/*.ts\" \"contracts/**/*.clar\" -c \"npm run test:report\""
|
|
12
|
+
},
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@hirosystems/clarinet-sdk": "^2.3.2",
|
|
17
|
+
"@stacks/transactions": "^6.12.0",
|
|
18
|
+
"chokidar-cli": "^3.0.0",
|
|
19
|
+
"typescript": "^5.3.3",
|
|
20
|
+
"vite": "^5.1.4",
|
|
21
|
+
"vitest": "^1.3.1",
|
|
22
|
+
"vitest-environment-clarinet": "^2.0.0"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log("Module interaction script placeholder for testing counter, flag, and score modules.");
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
[network]
|
|
2
|
+
name = "devnet"
|
|
3
|
+
deployment_fee_rate = 10
|
|
4
|
+
|
|
5
|
+
[accounts.deployer]
|
|
6
|
+
mnemonic = "twice kind fence tip hidden tilt action fragile skin nothing glory cousin green tomorrow spring wrist shed math olympic multiply hip blue scout claw"
|
|
7
|
+
balance = 100_000_000_000_000
|
|
8
|
+
# secret_key: 753b7cc01a1a2e86221266a154af739463fce51219d97e4f856cd7200c3bd2a601
|
|
9
|
+
# stx_address: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
|
|
10
|
+
# btc_address: mqVnk6NPRdhntvfm4hh9vvjiRkFDUuSYsH
|
|
11
|
+
|
|
12
|
+
[accounts.wallet_1]
|
|
13
|
+
mnemonic = "sell invite acquire kitten bamboo drastic jelly vivid peace spawn twice guilt pave pen trash pretty park cube fragile unaware remain midnight betray rebuild"
|
|
14
|
+
balance = 100_000_000_000_000
|
|
15
|
+
# secret_key: 7287ba251d44a4d3fd9276c88ce34c5c52a038955511cccaf77e61068649c17801
|
|
16
|
+
# stx_address: ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5
|
|
17
|
+
# btc_address: mr1iPkD9N3RJZZxXRk7xF9d36gffa6exNC
|
|
18
|
+
|
|
19
|
+
[accounts.wallet_2]
|
|
20
|
+
mnemonic = "hold excess usual excess ring elephant install account glad dry fragile donkey gaze humble truck breeze nation gasp vacuum limb head keep delay hospital"
|
|
21
|
+
balance = 100_000_000_000_000
|
|
22
|
+
# secret_key: 530d9f61984c888536871c6573073bdfc0058896dc1adfe9a6a10dfacadc209101
|
|
23
|
+
# stx_address: ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG
|
|
24
|
+
# btc_address: muYdXKmX9bByAueDe6KFfHd5Ff1gdN9ErG
|
|
25
|
+
|
|
26
|
+
[accounts.wallet_3]
|
|
27
|
+
mnemonic = "cycle puppy glare enroll cost improve round trend wrist mushroom scorpion tower claim oppose clever elephant dinosaur eight problem before frozen dune wagon high"
|
|
28
|
+
balance = 100_000_000_000_000
|
|
29
|
+
# secret_key: d655b2523bcd65e34889725c73064feb17ceb796831c0e111ba1a552b0f31b3901
|
|
30
|
+
# stx_address: ST2JHG361ZXG51QTKY2NQCVBPPRRE2KZB1HR05NNC
|
|
31
|
+
# btc_address: mvZtbibDAAA3WLpY7zXXFqRa3T4XSknBX7
|
|
32
|
+
|
|
33
|
+
[accounts.wallet_4]
|
|
34
|
+
mnemonic = "board list obtain sugar hour worth raven scout denial thunder horse logic fury scorpion fold genuine phrase wealth news aim below celery when cabin"
|
|
35
|
+
balance = 100_000_000_000_000
|
|
36
|
+
# secret_key: f9d7206a47f14d2870c163ebab4bf3e70d18f5d14ce1031f3902fbbc894fe4c701
|
|
37
|
+
# stx_address: ST2NEB84ASENDXKYGJPQW86YXQCEFEX2ZQPG87ND
|
|
38
|
+
# btc_address: mg1C76bNTutiCDV3t9nWhZs3Dc8LzUufj8
|
|
39
|
+
|
|
40
|
+
[accounts.wallet_5]
|
|
41
|
+
mnemonic = "hurry aunt blame peanut heavy update captain human rice crime juice adult scale device promote vast project quiz unit note reform update climb purchase"
|
|
42
|
+
balance = 100_000_000_000_000
|
|
43
|
+
# secret_key: 3eccc5dac8056590432db6a35d52b9896876a3d5cbdea53b72400bc9c2099fe801
|
|
44
|
+
# stx_address: ST2REHHS5J3CERCRBEPMGH7921Q6PYKAADT7JP2VB
|
|
45
|
+
# btc_address: mweN5WVqadScHdA81aATSdcVr4B6dNokqx
|
|
46
|
+
|
|
47
|
+
[accounts.wallet_6]
|
|
48
|
+
mnemonic = "area desk dutch sign gold cricket dawn toward giggle vibrant indoor bench warfare wagon number tiny universe sand talk dilemma pottery bone trap buddy"
|
|
49
|
+
balance = 100_000_000_000_000
|
|
50
|
+
# secret_key: 7036b29cb5e235e5fd9b09ae3e8eec4404e44906814d5d01cbca968a60ed4bfb01
|
|
51
|
+
# stx_address: ST3AM1A56AK2C1XAFJ4115ZSV26EB49BVQ10MGCS0
|
|
52
|
+
# btc_address: mzxXgV6e4BZSsz8zVHm3TmqbECt7mbuErt
|
|
53
|
+
|
|
54
|
+
[accounts.wallet_7]
|
|
55
|
+
mnemonic = "prevent gallery kind limb income control noise together echo rival record wedding sense uncover school version force bleak nuclear include danger skirt enact arrow"
|
|
56
|
+
balance = 100_000_000_000_000
|
|
57
|
+
# secret_key: b463f0df6c05d2f156393eee73f8016c5372caa0e9e29a901bb7171d90dc4f1401
|
|
58
|
+
# stx_address: ST3PF13W7Z0RRM42A8VZRVFQ75SV1K26RXEP8YGKJ
|
|
59
|
+
# btc_address: n37mwmru2oaVosgfuvzBwgV2ysCQRrLko7
|
|
60
|
+
|
|
61
|
+
[accounts.wallet_8]
|
|
62
|
+
mnemonic = "female adjust gallery certain visit token during great side clown fitness like hurt clip knife warm bench start reunion globe detail dream depend fortune"
|
|
63
|
+
balance = 100_000_000_000_000
|
|
64
|
+
# secret_key: 6a1a754ba863d7bab14adbbc3f8ebb090af9e871ace621d3e5ab634e1422885e01
|
|
65
|
+
# stx_address: ST3NBRSFKX28FQ2ZJ1MAKX58HKHSDGNV5N7R21XCP
|
|
66
|
+
# btc_address: n2v875jbJ4RjBnTjgbfikDfnwsDV5iUByw
|
|
67
|
+
|
|
68
|
+
[accounts.faucet]
|
|
69
|
+
mnemonic = "shadow private easily thought say logic fault paddle word top book during ignore notable orange flight clock image wealth health outside kitten belt reform"
|
|
70
|
+
balance = 100_000_000_000_000
|
|
71
|
+
# secret_key: de433bdfa14ec43aa1098d5be594c8ffb20a31485ff9de2923b2689471c401b801
|
|
72
|
+
# stx_address: STNHKEPYEPJ8ET55ZZ0M5A34J0R3N5FM2CMMMAZ6
|
|
73
|
+
# btc_address: mjSrB3wS4xab3kYqFktwBzfTdPg367ZJ2d
|
|
74
|
+
|
|
75
|
+
[devnet]
|
|
76
|
+
disable_stacks_explorer = false
|
|
77
|
+
disable_stacks_api = false
|
|
78
|
+
# disable_postgres = false
|
|
79
|
+
# disable_subnet_api = false
|
|
80
|
+
# disable_bitcoin_explorer = true
|
|
81
|
+
# working_dir = "tmp/devnet"
|
|
82
|
+
# stacks_node_events_observers = ["host.docker.internal:8002"]
|
|
83
|
+
# miner_mnemonic = "fragile loan twenty basic net assault jazz absorb diet talk art shock innocent float punch travel gadget embrace caught blossom hockey surround initial reduce"
|
|
84
|
+
# miner_derivation_path = "m/44'/5757'/0'/0/0"
|
|
85
|
+
# faucet_mnemonic = "shadow private easily thought say logic fault paddle word top book during ignore notable orange flight clock image wealth health outside kitten belt reform"
|
|
86
|
+
# faucet_derivation_path = "m/44'/5757'/0'/0/0"
|
|
87
|
+
# orchestrator_port = 20445
|
|
88
|
+
# bitcoin_node_p2p_port = 18444
|
|
89
|
+
# bitcoin_node_rpc_port = 18443
|
|
90
|
+
# bitcoin_node_username = "devnet"
|
|
91
|
+
# bitcoin_node_password = "devnet"
|
|
92
|
+
# bitcoin_controller_block_time = 30_000
|
|
93
|
+
# stacks_node_rpc_port = 20443
|
|
94
|
+
# stacks_node_p2p_port = 20444
|
|
95
|
+
# stacks_api_port = 3999
|
|
96
|
+
# stacks_api_events_port = 3700
|
|
97
|
+
# bitcoin_explorer_port = 8001
|
|
98
|
+
# stacks_explorer_port = 8000
|
|
99
|
+
# postgres_port = 5432
|
|
100
|
+
# postgres_username = "postgres"
|
|
101
|
+
# postgres_password = "postgres"
|
|
102
|
+
# postgres_database = "postgres"
|
|
103
|
+
# bitcoin_node_image_url = "quay.io/hirosystems/bitcoind:26.0"
|
|
104
|
+
# stacks_node_image_url = "quay.io/hirosystems/stacks-node:devnet-3.0"
|
|
105
|
+
# stacks_signer_image_url = "quay.io/hirosystems/stacks-signer:devnet-3.0"
|
|
106
|
+
# stacks_api_image_url = "hirosystems/stacks-blockchain-api:master"
|
|
107
|
+
# stacks_explorer_image_url = "hirosystems/explorer:latest"
|
|
108
|
+
# bitcoin_explorer_image_url = "quay.io/hirosystems/bitcoin-explorer:devnet"
|
|
109
|
+
# postgres_image_url = "postgres:alpine"
|
|
110
|
+
# enable_subnet_node = true
|
|
111
|
+
# subnet_node_image_url = "hirosystems/stacks-subnets:0.8.1"
|
|
112
|
+
# subnet_leader_mnemonic = "twice kind fence tip hidden tilt action fragile skin nothing glory cousin green tomorrow spring wrist shed math olympic multiply hip blue scout claw"
|
|
113
|
+
# subnet_leader_derivation_path = "m/44'/5757'/0'/0/0"
|
|
114
|
+
# subnet_contract_id = "ST173JK7NZBA4BS05ZRATQH1K89YJMTGEH1Z5J52E.subnet-v3-0-1"
|
|
115
|
+
# subnet_node_rpc_port = 30443
|
|
116
|
+
# subnet_node_p2p_port = 30444
|
|
117
|
+
# subnet_events_ingestion_port = 30445
|
|
118
|
+
# subnet_node_events_observers = ["host.docker.internal:8002"]
|
|
119
|
+
# subnet_api_image_url = "hirosystems/stacks-blockchain-api:master"
|
|
120
|
+
# subnet_api_postgres_database = "subnet_api"
|
|
121
|
+
|
|
122
|
+
# epoch_2_0 = 100
|
|
123
|
+
# epoch_2_05 = 100
|
|
124
|
+
# epoch_2_1 = 101
|
|
125
|
+
# epoch_2_2 = 102
|
|
126
|
+
# epoch_2_3 = 103
|
|
127
|
+
# epoch_2_4 = 104
|
|
128
|
+
# epoch_2_5 = 108
|
|
129
|
+
# epoch_3_0 = 142
|
|
130
|
+
|
|
131
|
+
# Send some stacking orders
|
|
132
|
+
[[devnet.pox_stacking_orders]]
|
|
133
|
+
start_at_cycle = 1
|
|
134
|
+
duration = 10
|
|
135
|
+
auto_extend = true
|
|
136
|
+
wallet = "wallet_1"
|
|
137
|
+
slots = 2
|
|
138
|
+
btc_address = "mr1iPkD9N3RJZZxXRk7xF9d36gffa6exNC"
|
|
139
|
+
|
|
140
|
+
[[devnet.pox_stacking_orders]]
|
|
141
|
+
start_at_cycle = 1
|
|
142
|
+
duration = 10
|
|
143
|
+
auto_extend = true
|
|
144
|
+
wallet = "wallet_2"
|
|
145
|
+
slots = 2
|
|
146
|
+
btc_address = "muYdXKmX9bByAueDe6KFfHd5Ff1gdN9ErG"
|
|
147
|
+
|
|
148
|
+
[[devnet.pox_stacking_orders]]
|
|
149
|
+
start_at_cycle = 1
|
|
150
|
+
duration = 10
|
|
151
|
+
auto_extend = true
|
|
152
|
+
wallet = "wallet_3"
|
|
153
|
+
slots = 2
|
|
154
|
+
btc_address = "mvZtbibDAAA3WLpY7zXXFqRa3T4XSknBX7"
|
|
155
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
const accounts = simnet.getAccounts();
|
|
5
|
+
const address1 = accounts.get("wallet_1")!;
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
The test below is an example. To learn more, read the testing documentation here:
|
|
9
|
+
https://docs.hiro.so/stacks/clarinet-js-sdk
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
describe("example tests", () => {
|
|
13
|
+
it("ensures simnet is well initalised", () => {
|
|
14
|
+
expect(simnet.blockHeight).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// it("shows an example", () => {
|
|
18
|
+
// const { result } = simnet.callReadOnlyFn("counter", "get-counter", [], address1);
|
|
19
|
+
// expect(result).toBeUint(0);
|
|
20
|
+
// });
|
|
21
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
const accounts = simnet.getAccounts();
|
|
5
|
+
const address1 = accounts.get("wallet_1")!;
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
The test below is an example. To learn more, read the testing documentation here:
|
|
9
|
+
https://docs.hiro.so/stacks/clarinet-js-sdk
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
describe("example tests", () => {
|
|
13
|
+
it("ensures simnet is well initalised", () => {
|
|
14
|
+
expect(simnet.blockHeight).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// it("shows an example", () => {
|
|
18
|
+
// const { result } = simnet.callReadOnlyFn("counter", "get-counter", [], address1);
|
|
19
|
+
// expect(result).toBeUint(0);
|
|
20
|
+
// });
|
|
21
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
const accounts = simnet.getAccounts();
|
|
5
|
+
const address1 = accounts.get("wallet_1")!;
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
The test below is an example. To learn more, read the testing documentation here:
|
|
9
|
+
https://docs.hiro.so/stacks/clarinet-js-sdk
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
describe("example tests", () => {
|
|
13
|
+
it("ensures simnet is well initalised", () => {
|
|
14
|
+
expect(simnet.blockHeight).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// it("shows an example", () => {
|
|
18
|
+
// const { result } = simnet.callReadOnlyFn("counter", "get-counter", [], address1);
|
|
19
|
+
// expect(result).toBeUint(0);
|
|
20
|
+
// });
|
|
21
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Clarinet, Tx, Chain, Account, types } from "clarinet";
|
|
2
|
+
|
|
3
|
+
Clarinet.test({
|
|
4
|
+
name: "Initialize and increase reputation",
|
|
5
|
+
async fn(chain: Chain, accounts: Map<string, Account>) {
|
|
6
|
+
|
|
7
|
+
const deployer = accounts.get("deployer")!;
|
|
8
|
+
const wallet1 = accounts.get("wallet_1")!;
|
|
9
|
+
|
|
10
|
+
let block = chain.mineBlock([
|
|
11
|
+
Tx.contractCall(
|
|
12
|
+
"reputation-engine",
|
|
13
|
+
"init-user",
|
|
14
|
+
[types.principal(wallet1.address)],
|
|
15
|
+
wallet1.address
|
|
16
|
+
)
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
block.receipts[0].result.expectOk();
|
|
20
|
+
|
|
21
|
+
block = chain.mineBlock([
|
|
22
|
+
Tx.contractCall(
|
|
23
|
+
"reputation-engine",
|
|
24
|
+
"increase-score",
|
|
25
|
+
[types.principal(wallet1.address), types.uint(100)],
|
|
26
|
+
deployer.address
|
|
27
|
+
)
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
block.receipts[0].result.expectOk();
|
|
31
|
+
|
|
32
|
+
let call = chain.callReadOnlyFn(
|
|
33
|
+
"reputation-engine",
|
|
34
|
+
"get-user",
|
|
35
|
+
[types.principal(wallet1.address)],
|
|
36
|
+
deployer.address
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
call.result.expectSome();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
|
|
3
|
+
describe("Reputation Engine", () => {
|
|
4
|
+
it("should initialize correctly", () => {
|
|
5
|
+
const initialScore = 0;
|
|
6
|
+
expect(initialScore).toBe(0);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it("should increment score logic", () => {
|
|
10
|
+
const current = 10;
|
|
11
|
+
const added = 5;
|
|
12
|
+
const result = current + added;
|
|
13
|
+
expect(result).toBe(15);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { Cl } from "@stacks/transactions";
|
|
3
|
+
|
|
4
|
+
const accounts = simnet.getAccounts();
|
|
5
|
+
const deployer = accounts.get("deployer")!;
|
|
6
|
+
const wallet1 = accounts.get("wallet_1")!;
|
|
7
|
+
const wallet2 = accounts.get("wallet_2")!;
|
|
8
|
+
|
|
9
|
+
describe("Token One (SIP-010) Test Suite", () => {
|
|
10
|
+
it("ensures simnet is well initialised", () => {
|
|
11
|
+
expect(simnet.blockHeight).toBeDefined();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
describe("Token Metadata", () => {
|
|
15
|
+
it("returns correct token name", () => {
|
|
16
|
+
const { result } = simnet.callReadOnlyFn("token-one", "get-name", [], deployer);
|
|
17
|
+
expect(result).toBeOk(Cl.stringAscii("Stacks One"));
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("returns correct token symbol", () => {
|
|
21
|
+
const { result } = simnet.callReadOnlyFn("token-one", "get-symbol", [], deployer);
|
|
22
|
+
expect(result).toBeOk(Cl.stringAscii("ONE"));
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("returns correct decimals", () => {
|
|
26
|
+
const { result } = simnet.callReadOnlyFn("token-one", "get-decimals", [], deployer);
|
|
27
|
+
expect(result).toBeOk(Cl.uint(6));
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("returns correct initial total supply (0)", () => {
|
|
31
|
+
const { result } = simnet.callReadOnlyFn("token-one", "get-total-supply", [], deployer);
|
|
32
|
+
expect(result).toBeOk(Cl.uint(0));
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe("Minting and Balances", () => {
|
|
37
|
+
it("allows contract owner to mint tokens", () => {
|
|
38
|
+
const mintAmount = 1000000;
|
|
39
|
+
|
|
40
|
+
const { result } = simnet.callPublicFn(
|
|
41
|
+
"token-one",
|
|
42
|
+
"mint",
|
|
43
|
+
[Cl.uint(mintAmount), Cl.principal(wallet1)],
|
|
44
|
+
deployer
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
expect(result).toBeOk(Cl.bool(true));
|
|
48
|
+
|
|
49
|
+
// Verify wallet1 balance
|
|
50
|
+
const balance = simnet.callReadOnlyFn("token-one", "get-balance", [Cl.principal(wallet1)], deployer);
|
|
51
|
+
expect(balance.result).toBeOk(Cl.uint(mintAmount));
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("prevents unauthorized wallets from minting", () => {
|
|
55
|
+
const { result } = simnet.callPublicFn(
|
|
56
|
+
"token-one",
|
|
57
|
+
"mint",
|
|
58
|
+
[Cl.uint(1000000), Cl.principal(wallet2)],
|
|
59
|
+
wallet1
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
expect(result).toBeErr(Cl.uint(101));
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
describe("Transfers", () => {
|
|
67
|
+
it("allows successful transfer between wallets", () => {
|
|
68
|
+
// 1. Mint 1M tokens to wallet1
|
|
69
|
+
simnet.callPublicFn("token-one", "mint", [Cl.uint(1000000), Cl.principal(wallet1)], deployer);
|
|
70
|
+
|
|
71
|
+
// 2. Transfer 400k tokens from wallet1 to wallet2
|
|
72
|
+
const { result } = simnet.callPublicFn(
|
|
73
|
+
"token-one",
|
|
74
|
+
"transfer",
|
|
75
|
+
[Cl.uint(400000), Cl.principal(wallet1), Cl.principal(wallet2), Cl.none()],
|
|
76
|
+
wallet1
|
|
77
|
+
);
|
|
78
|
+
expect(result).toBeOk(Cl.bool(true));
|
|
79
|
+
|
|
80
|
+
// 3. Verify balances
|
|
81
|
+
const bal1 = simnet.callReadOnlyFn("token-one", "get-balance", [Cl.principal(wallet1)], deployer);
|
|
82
|
+
expect(bal1.result).toBeOk(Cl.uint(600000));
|
|
83
|
+
|
|
84
|
+
const bal2 = simnet.callReadOnlyFn("token-one", "get-balance", [Cl.principal(wallet2)], deployer);
|
|
85
|
+
expect(bal2.result).toBeOk(Cl.uint(400000));
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("prevents transfer if sender is not tx-sender", () => {
|
|
89
|
+
simnet.callPublicFn("token-one", "mint", [Cl.uint(1000000), Cl.principal(wallet1)], deployer);
|
|
90
|
+
|
|
91
|
+
// wallet2 tries to maliciously transfer wallet1's tokens
|
|
92
|
+
const { result } = simnet.callPublicFn(
|
|
93
|
+
"token-one",
|
|
94
|
+
"transfer",
|
|
95
|
+
[Cl.uint(100000), Cl.principal(wallet1), Cl.principal(wallet2), Cl.none()],
|
|
96
|
+
wallet2
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
expect(result).toBeErr(Cl.uint(101));
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
{
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"lib": ["ESNext"],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
"strict": true,
|
|
17
|
+
"noImplicitAny": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true
|
|
21
|
+
},
|
|
22
|
+
"include": [
|
|
23
|
+
"node_modules/@hirosystems/clarinet-sdk/vitest-helpers/src",
|
|
24
|
+
"tests"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
/// <reference types="vitest" />
|
|
3
|
+
|
|
4
|
+
import { defineConfig } from "vite";
|
|
5
|
+
import { vitestSetupFilePath, getClarinetVitestsArgv } from "@hirosystems/clarinet-sdk/vitest";
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
In this file, Vitest is configured so that it works seamlessly with Clarinet and the Simnet.
|
|
9
|
+
|
|
10
|
+
The `vitest-environment-clarinet` will initialise the clarinet-sdk
|
|
11
|
+
and make the `simnet` object available globally in the test files.
|
|
12
|
+
|
|
13
|
+
`vitestSetupFilePath` points to a file in the `@hirosystems/clarinet-sdk` package that does two things:
|
|
14
|
+
- run `before` hooks to initialize the simnet and `after` hooks to collect costs and coverage reports.
|
|
15
|
+
- load custom vitest matchers to work with Clarity values (such as `expect(...).toBeUint()`)
|
|
16
|
+
|
|
17
|
+
The `getClarinetVitestsArgv()` will parse options passed to the command `vitest run --`
|
|
18
|
+
- vitest run -- --manifest ./Clarinet.toml # pass a custom path
|
|
19
|
+
- vitest run -- --coverage --costs # collect coverage and cost reports
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export default defineConfig({
|
|
23
|
+
test: {
|
|
24
|
+
environment: "clarinet", // use vitest-environment-clarinet
|
|
25
|
+
pool: "forks",
|
|
26
|
+
poolOptions: {
|
|
27
|
+
threads: { singleThread: true },
|
|
28
|
+
forks: { singleFork: true },
|
|
29
|
+
},
|
|
30
|
+
setupFiles: [
|
|
31
|
+
vitestSetupFilePath,
|
|
32
|
+
// custom setup files can be added here
|
|
33
|
+
],
|
|
34
|
+
environmentOptions: {
|
|
35
|
+
clarinet: {
|
|
36
|
+
...getClarinetVitestsArgv(),
|
|
37
|
+
// add or override options
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
package/src/App.css
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#root {
|
|
2
|
+
max-width: 1280px;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
padding: 2rem;
|
|
5
|
+
text-align: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.logo {
|
|
9
|
+
height: 6em;
|
|
10
|
+
padding: 1.5em;
|
|
11
|
+
will-change: filter;
|
|
12
|
+
transition: filter 300ms;
|
|
13
|
+
}
|
|
14
|
+
.logo:hover {
|
|
15
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
16
|
+
}
|
|
17
|
+
.logo.react:hover {
|
|
18
|
+
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes logo-spin {
|
|
22
|
+
from {
|
|
23
|
+
transform: rotate(0deg);
|
|
24
|
+
}
|
|
25
|
+
to {
|
|
26
|
+
transform: rotate(360deg);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
31
|
+
a:nth-of-type(2) .logo {
|
|
32
|
+
animation: logo-spin infinite 20s linear;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.card {
|
|
37
|
+
padding: 2em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.read-the-docs {
|
|
41
|
+
color: #888;
|
|
42
|
+
}
|