@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,153 @@
|
|
|
1
|
+
;; staking-refinery-v5.clar
|
|
2
|
+
;; @version 2
|
|
3
|
+
|
|
4
|
+
(define-constant err-not-found (err u300))
|
|
5
|
+
(define-constant err-locked (err u301))
|
|
6
|
+
(define-constant err-already-claimed (err u302))
|
|
7
|
+
|
|
8
|
+
(define-data-var lock-period uint u1008)
|
|
9
|
+
(define-data-var nonce uint u0)
|
|
10
|
+
|
|
11
|
+
(define-map stakes
|
|
12
|
+
{ user: principal, id: uint }
|
|
13
|
+
{ amount: uint, start: uint, end: uint, claimed: bool }
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
;; =========================
|
|
17
|
+
;; READ ONLY STATUS
|
|
18
|
+
;; =========================
|
|
19
|
+
|
|
20
|
+
(define-read-only (get-stake-status (user principal) (id uint))
|
|
21
|
+
(let
|
|
22
|
+
(
|
|
23
|
+
(data (map-get? stakes { user: user, id: id }))
|
|
24
|
+
(current burn-block-height)
|
|
25
|
+
)
|
|
26
|
+
(match data d
|
|
27
|
+
{
|
|
28
|
+
start: (get start d),
|
|
29
|
+
end: (get end d),
|
|
30
|
+
current: current,
|
|
31
|
+
blocks-left:
|
|
32
|
+
(if (>= current (get end d))
|
|
33
|
+
u0
|
|
34
|
+
(- (get end d) current)
|
|
35
|
+
),
|
|
36
|
+
claimed: (get claimed d)
|
|
37
|
+
}
|
|
38
|
+
{
|
|
39
|
+
start: u0,
|
|
40
|
+
end: u0,
|
|
41
|
+
current: current,
|
|
42
|
+
blocks-left: u0,
|
|
43
|
+
claimed: false
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
;; =========================
|
|
50
|
+
;; STAKE
|
|
51
|
+
;; =========================
|
|
52
|
+
|
|
53
|
+
(define-public (stake (amount uint))
|
|
54
|
+
(let
|
|
55
|
+
(
|
|
56
|
+
(user tx-sender)
|
|
57
|
+
(id (var-get nonce))
|
|
58
|
+
(end (+ burn-block-height (var-get lock-period)))
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
;; Transfer poin dari user ke alamat smart contract ini
|
|
62
|
+
;; Menggunakan try! untuk menangani response dari contract-call?
|
|
63
|
+
(try! (contract-call? .token-poin-v5 transfer amount tx-sender (as-contract tx-sender)))
|
|
64
|
+
|
|
65
|
+
(map-set stakes
|
|
66
|
+
{ user: user, id: id }
|
|
67
|
+
{
|
|
68
|
+
amount: amount,
|
|
69
|
+
start: burn-block-height,
|
|
70
|
+
end: end,
|
|
71
|
+
claimed: false
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
(var-set nonce (+ id u1))
|
|
76
|
+
(ok id)
|
|
77
|
+
)
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
;; =========================
|
|
81
|
+
;; HARVEST
|
|
82
|
+
;; =========================
|
|
83
|
+
|
|
84
|
+
(define-public (harvest (id uint))
|
|
85
|
+
(let
|
|
86
|
+
(
|
|
87
|
+
(user tx-sender)
|
|
88
|
+
(data (unwrap! (map-get? stakes { user: user, id: id }) err-not-found))
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
;; Pastikan waktu lock sudah habis
|
|
92
|
+
(asserts! (>= burn-block-height (get end data)) err-locked)
|
|
93
|
+
|
|
94
|
+
;; Pastikan belum pernah di-claim sebelumnya
|
|
95
|
+
(asserts! (not (get claimed data)) err-already-claimed)
|
|
96
|
+
|
|
97
|
+
(let
|
|
98
|
+
(
|
|
99
|
+
(reward (/ (get amount data) u10))
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
;; Kembalikan poin dari kontrak ke user
|
|
103
|
+
(try! (as-contract (contract-call? .token-poin-v5 transfer (get amount data) tx-sender user)))
|
|
104
|
+
|
|
105
|
+
;; Mint reward ONE dari kontrak ke user
|
|
106
|
+
(try! (as-contract (contract-call? .token-one-v5 mint reward user)))
|
|
107
|
+
|
|
108
|
+
;; Update status menjadi claimed
|
|
109
|
+
(map-set stakes
|
|
110
|
+
{ user: user, id: id }
|
|
111
|
+
(merge data { claimed: true })
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
(ok reward)
|
|
115
|
+
)
|
|
116
|
+
)
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
(define-public (ping-42)
|
|
120
|
+
(ok true))
|
|
121
|
+
|
|
122
|
+
(define-public (ping-84)
|
|
123
|
+
(ok true))
|
|
124
|
+
|
|
125
|
+
(define-public (ping-23)
|
|
126
|
+
(ok true))
|
|
127
|
+
|
|
128
|
+
(define-public (ping-46)
|
|
129
|
+
(ok true))
|
|
130
|
+
|
|
131
|
+
(define-public (ping-108)
|
|
132
|
+
(ok true))
|
|
133
|
+
|
|
134
|
+
(define-public (ping-169)
|
|
135
|
+
(ok true))
|
|
136
|
+
|
|
137
|
+
(define-public (ping-62)
|
|
138
|
+
(ok true))
|
|
139
|
+
|
|
140
|
+
(define-public (ping-33)
|
|
141
|
+
(ok true))
|
|
142
|
+
|
|
143
|
+
(define-public (ping-77)
|
|
144
|
+
(ok true))
|
|
145
|
+
|
|
146
|
+
(define-public (ping-125)
|
|
147
|
+
(ok true))
|
|
148
|
+
|
|
149
|
+
(define-public (ping-89)
|
|
150
|
+
(ok true))
|
|
151
|
+
|
|
152
|
+
(define-public (ping-29)
|
|
153
|
+
(ok true))
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
;; staking-refinery-v6.clar
|
|
2
|
+
|
|
3
|
+
(define-constant err-not-found (err u300))
|
|
4
|
+
(define-constant err-locked (err u301))
|
|
5
|
+
(define-constant err-already-claimed (err u302)) ;; Mencegah harvest berkali-kali
|
|
6
|
+
|
|
7
|
+
(define-data-var lock-period uint u1008)
|
|
8
|
+
(define-data-var nonce uint u0)
|
|
9
|
+
|
|
10
|
+
(define-map stakes
|
|
11
|
+
{ user: principal, id: uint }
|
|
12
|
+
{ amount: uint, start: uint, end: uint, claimed: bool }
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
;; =========================
|
|
16
|
+
;; READ ONLY STATUS
|
|
17
|
+
;; =========================
|
|
18
|
+
|
|
19
|
+
(define-read-only (get-stake-status (user principal) (id uint))
|
|
20
|
+
(let
|
|
21
|
+
(
|
|
22
|
+
(data (map-get? stakes { user: user, id: id }))
|
|
23
|
+
(current burn-block-height)
|
|
24
|
+
)
|
|
25
|
+
(match data d
|
|
26
|
+
{
|
|
27
|
+
start: (get start d),
|
|
28
|
+
end: (get end d),
|
|
29
|
+
current: current,
|
|
30
|
+
blocks-left:
|
|
31
|
+
(if (>= current (get end d))
|
|
32
|
+
u0
|
|
33
|
+
(- (get end d) current)
|
|
34
|
+
),
|
|
35
|
+
claimed: (get claimed d)
|
|
36
|
+
}
|
|
37
|
+
{
|
|
38
|
+
start: u0,
|
|
39
|
+
end: u0,
|
|
40
|
+
current: current,
|
|
41
|
+
blocks-left: u0,
|
|
42
|
+
claimed: false
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
;; =========================
|
|
49
|
+
;; STAKE
|
|
50
|
+
;; =========================
|
|
51
|
+
|
|
52
|
+
(define-public (stake (amount uint))
|
|
53
|
+
(let
|
|
54
|
+
(
|
|
55
|
+
(user tx-sender)
|
|
56
|
+
(id (var-get nonce))
|
|
57
|
+
(end (+ burn-block-height (var-get lock-period)))
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
;; Menggunakan (as-contract tx-sender) agar poin berpindah dan tersimpan ke dalam kontrak dengan benar
|
|
61
|
+
(try! (contract-call? .token-poin-v6 transfer amount user (as-contract tx-sender)))
|
|
62
|
+
|
|
63
|
+
(map-set stakes
|
|
64
|
+
{ user: user, id: id }
|
|
65
|
+
{
|
|
66
|
+
amount: amount,
|
|
67
|
+
start: burn-block-height,
|
|
68
|
+
end: end,
|
|
69
|
+
claimed: false
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
(var-set nonce (+ id u1))
|
|
74
|
+
(ok id)
|
|
75
|
+
)
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
;; =========================
|
|
79
|
+
;; HARVEST
|
|
80
|
+
;; =========================
|
|
81
|
+
|
|
82
|
+
(define-public (harvest (id uint))
|
|
83
|
+
(let
|
|
84
|
+
(
|
|
85
|
+
(user tx-sender)
|
|
86
|
+
(data (unwrap! (map-get? stakes { user: user, id: id }) err-not-found))
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
(asserts! (>= burn-block-height (get end data)) err-locked)
|
|
90
|
+
;; Validasi agar tidak bisa double-claim
|
|
91
|
+
(asserts! (not (get claimed data)) err-already-claimed)
|
|
92
|
+
|
|
93
|
+
(let
|
|
94
|
+
(
|
|
95
|
+
(reward (/ (get amount data) u10))
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
;; Menggunakan as-contract untuk mengembalikan poin yang tersimpan di kontrak ke user
|
|
99
|
+
(try! (as-contract (contract-call? .token-poin-v6 transfer (get amount data) tx-sender user)))
|
|
100
|
+
|
|
101
|
+
;; Mint reward token ONE dari v6
|
|
102
|
+
(try! (contract-call? .token-one-v6 mint reward user))
|
|
103
|
+
|
|
104
|
+
;; Memperbarui status agar tidak bisa di-harvest lagi
|
|
105
|
+
(map-set stakes { user: user, id: id } (merge data { claimed: true }))
|
|
106
|
+
|
|
107
|
+
(ok reward)
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
(define-public (ping-122)
|
|
113
|
+
(ok true))
|
|
114
|
+
|
|
115
|
+
(define-public (ping-35)
|
|
116
|
+
(ok true))
|
|
117
|
+
|
|
118
|
+
(define-public (ping-152)
|
|
119
|
+
(ok true))
|
|
120
|
+
|
|
121
|
+
(define-public (ping-129)
|
|
122
|
+
(ok true))
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
;; staking-refinery-v7.clar
|
|
2
|
+
|
|
3
|
+
(define-constant err-not-found (err u300))
|
|
4
|
+
(define-constant err-locked (err u301))
|
|
5
|
+
(define-constant err-already-claimed (err u302))
|
|
6
|
+
|
|
7
|
+
(define-data-var lock-period uint u1008)
|
|
8
|
+
(define-data-var nonce uint u0)
|
|
9
|
+
|
|
10
|
+
(define-map stakes
|
|
11
|
+
{ user: principal, id: uint }
|
|
12
|
+
{ amount: uint, start: uint, end: uint, claimed: bool }
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
;; =========================
|
|
16
|
+
;; READ ONLY STATUS
|
|
17
|
+
;; =========================
|
|
18
|
+
|
|
19
|
+
(define-read-only (get-stake-status (user principal) (id uint))
|
|
20
|
+
(let
|
|
21
|
+
(
|
|
22
|
+
(data (map-get? stakes { user: user, id: id }))
|
|
23
|
+
(current burn-block-height)
|
|
24
|
+
)
|
|
25
|
+
(match data d
|
|
26
|
+
{
|
|
27
|
+
start: (get start d),
|
|
28
|
+
end: (get end d),
|
|
29
|
+
current: current,
|
|
30
|
+
blocks-left:
|
|
31
|
+
(if (>= current (get end d))
|
|
32
|
+
u0
|
|
33
|
+
(- (get end d) current)
|
|
34
|
+
),
|
|
35
|
+
claimed: (get claimed d)
|
|
36
|
+
}
|
|
37
|
+
{
|
|
38
|
+
start: u0,
|
|
39
|
+
end: u0,
|
|
40
|
+
current: current,
|
|
41
|
+
blocks-left: u0,
|
|
42
|
+
claimed: false
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
;; =========================
|
|
49
|
+
;; STAKE
|
|
50
|
+
;; =========================
|
|
51
|
+
|
|
52
|
+
(define-public (stake (amount uint))
|
|
53
|
+
(let
|
|
54
|
+
(
|
|
55
|
+
(user tx-sender)
|
|
56
|
+
(id (var-get nonce))
|
|
57
|
+
(end (+ burn-block-height (var-get lock-period)))
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
;; Menggunakan poin v7
|
|
61
|
+
(try! (contract-call? .token-poin-v7 transfer amount user (as-contract tx-sender)))
|
|
62
|
+
|
|
63
|
+
(map-set stakes
|
|
64
|
+
{ user: user, id: id }
|
|
65
|
+
{
|
|
66
|
+
amount: amount,
|
|
67
|
+
start: burn-block-height,
|
|
68
|
+
end: end,
|
|
69
|
+
claimed: false
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
(var-set nonce (+ id u1))
|
|
74
|
+
(ok id)
|
|
75
|
+
)
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
;; =========================
|
|
79
|
+
;; HARVEST
|
|
80
|
+
;; =========================
|
|
81
|
+
|
|
82
|
+
(define-public (harvest (id uint))
|
|
83
|
+
(let
|
|
84
|
+
(
|
|
85
|
+
(user tx-sender)
|
|
86
|
+
(data (unwrap! (map-get? stakes { user: user, id: id }) err-not-found))
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
(asserts! (>= burn-block-height (get end data)) err-locked)
|
|
90
|
+
(asserts! (not (get claimed data)) err-already-claimed)
|
|
91
|
+
|
|
92
|
+
(let
|
|
93
|
+
(
|
|
94
|
+
(reward (/ (get amount data) u10))
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
;; Menggunakan poin v7
|
|
98
|
+
(try! (as-contract (contract-call? .token-poin-v7 transfer (get amount data) tx-sender user)))
|
|
99
|
+
|
|
100
|
+
;; Mint reward token ONE dari v7
|
|
101
|
+
(try! (contract-call? .token-one-v7 mint reward user))
|
|
102
|
+
|
|
103
|
+
(map-set stakes { user: user, id: id } (merge data { claimed: true }))
|
|
104
|
+
|
|
105
|
+
(ok reward)
|
|
106
|
+
)
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
(define-public (ping-57)
|
|
111
|
+
(ok true))
|
|
112
|
+
|
|
113
|
+
(define-public (ping-120)
|
|
114
|
+
(ok true))
|
|
115
|
+
|
|
116
|
+
(define-public (ping-141)
|
|
117
|
+
(ok true))
|
|
118
|
+
|
|
119
|
+
(define-public (ping-103)
|
|
120
|
+
(ok true))
|
|
121
|
+
|
|
122
|
+
(define-public (ping-34)
|
|
123
|
+
(ok true))
|
|
124
|
+
|
|
125
|
+
(define-public (ping-23)
|
|
126
|
+
(ok true))
|
|
127
|
+
|
|
128
|
+
(define-public (ping-205)
|
|
129
|
+
(ok true))
|
|
130
|
+
|
|
131
|
+
(define-public (ping-76)
|
|
132
|
+
(ok true))
|
|
133
|
+
|
|
134
|
+
(define-public (ping-299)
|
|
135
|
+
(ok true))
|
|
136
|
+
|
|
137
|
+
(define-public (ping-116)
|
|
138
|
+
(ok true))
|
|
139
|
+
|
|
140
|
+
(define-public (ping-211)
|
|
141
|
+
(ok true))
|
|
142
|
+
|
|
143
|
+
(define-public (ping-270)
|
|
144
|
+
(ok true))
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
;; staking-refinery.clar
|
|
2
|
+
;; Mengubah Token Poin menjadi Token ONE melalui Staking
|
|
3
|
+
|
|
4
|
+
(define-constant err-lock-period-not-finished (err u300))
|
|
5
|
+
(define-constant err-not-found (err u301))
|
|
6
|
+
|
|
7
|
+
;; Pilihan durasi: 7 hari (~1000 blok) atau 30 hari (~4300 blok)
|
|
8
|
+
(define-data-var lock-period-short uint u1008) ;; ~1 minggu
|
|
9
|
+
(define-constant exchange-rate u10) ;; 100 POIN = 10 ONE (contoh)
|
|
10
|
+
|
|
11
|
+
(define-map stakes
|
|
12
|
+
{ staker: principal, id: uint }
|
|
13
|
+
{ amount-poin: uint, start-height: uint, end-height: uint, claimed: bool }
|
|
14
|
+
)
|
|
15
|
+
(define-data-var stake-nonce uint u0)
|
|
16
|
+
|
|
17
|
+
(define-public (stake-tokens (amount-poin uint))
|
|
18
|
+
(let
|
|
19
|
+
(
|
|
20
|
+
(user tx-sender)
|
|
21
|
+
(current-id (var-get stake-nonce))
|
|
22
|
+
(end-block (+ block-height (var-get lock-period-short)))
|
|
23
|
+
)
|
|
24
|
+
;; Transfer POIN dari user ke kontrak ini (dikunci)
|
|
25
|
+
(try! (contract-call? .token-poin transfer amount-poin user (as-contract tx-sender) none))
|
|
26
|
+
|
|
27
|
+
;; Simpan data staking
|
|
28
|
+
(map-set stakes { staker: user, id: current-id }
|
|
29
|
+
{
|
|
30
|
+
amount-poin: amount-poin,
|
|
31
|
+
start-height: block-height,
|
|
32
|
+
end-height: end-block,
|
|
33
|
+
claimed: false
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
(var-set stake-nonce (+ current-id u1))
|
|
37
|
+
(ok current-id)
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
(define-public (harvest (stake-id uint))
|
|
42
|
+
(let
|
|
43
|
+
(
|
|
44
|
+
(user tx-sender)
|
|
45
|
+
(stake-data (unwrap! (map-get? stakes { staker: user, id: stake-id }) err-not-found))
|
|
46
|
+
)
|
|
47
|
+
;; Validasi
|
|
48
|
+
(asserts! (>= block-height (get end-height stake-data)) err-lock-period-not-finished)
|
|
49
|
+
(asserts! (is-eq (get claimed stake-data) false) (err u302))
|
|
50
|
+
|
|
51
|
+
;; Hitung Reward (Misal 10% dari poin yang distake dikonversi jadi ONE)
|
|
52
|
+
(let
|
|
53
|
+
(
|
|
54
|
+
(reward-amount (/ (get amount-poin stake-data) exchange-rate))
|
|
55
|
+
)
|
|
56
|
+
;; Update status jadi claimed
|
|
57
|
+
(map-set stakes { staker: user, id: stake-id }
|
|
58
|
+
(merge stake-data { claimed: true })
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
;; Kembalikan POIN user
|
|
62
|
+
(try! (as-contract (contract-call? .token-poin transfer (get amount-poin stake-data) tx-sender user none)))
|
|
63
|
+
|
|
64
|
+
;; Mint Reward ONE ke user
|
|
65
|
+
(as-contract (contract-call? .token-one mint reward-amount user))
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
(define-public (ping-59)
|
|
71
|
+
(ok true))
|
|
72
|
+
|
|
73
|
+
(define-public (ping-67)
|
|
74
|
+
(ok true))
|
|
75
|
+
|
|
76
|
+
(define-public (ping-15)
|
|
77
|
+
(ok true))
|
|
78
|
+
|
|
79
|
+
(define-public (ping-114)
|
|
80
|
+
(ok true))
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
(impl-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)
|
|
2
|
+
|
|
3
|
+
(define-fungible-token token-one-v3)
|
|
4
|
+
|
|
5
|
+
(define-constant contract-owner tx-sender)
|
|
6
|
+
(define-constant err-owner-only (err u100))
|
|
7
|
+
(define-constant err-not-authorized (err u101))
|
|
8
|
+
|
|
9
|
+
(define-map approved-minters principal bool)
|
|
10
|
+
|
|
11
|
+
(define-read-only (get-balance (who principal))
|
|
12
|
+
(ok (ft-get-balance token-one-v3 who))
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
(define-read-only (get-total-supply)
|
|
16
|
+
(ok (ft-get-supply token-one-v3))
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
(define-read-only (get-name)
|
|
20
|
+
(ok "Stacks One V3")
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
(define-read-only (get-symbol)
|
|
24
|
+
(ok "ONE")
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
(define-read-only (get-decimals)
|
|
28
|
+
(ok u6)
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
(define-read-only (get-token-uri)
|
|
32
|
+
(ok none)
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
(define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 34))))
|
|
36
|
+
(begin
|
|
37
|
+
(asserts! (is-eq tx-sender sender) err-not-authorized)
|
|
38
|
+
(try! (ft-transfer? token-one-v3 amount sender recipient))
|
|
39
|
+
(match memo to-print (print to-print) 0x)
|
|
40
|
+
(ok true)
|
|
41
|
+
)
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
(define-public (mint (amount uint) (recipient principal))
|
|
45
|
+
(let
|
|
46
|
+
(
|
|
47
|
+
(is-approved (default-to false (map-get? approved-minters tx-sender)))
|
|
48
|
+
)
|
|
49
|
+
(asserts! (or (is-eq tx-sender contract-owner) is-approved) err-not-authorized)
|
|
50
|
+
(ft-mint? token-one-v3 amount recipient)
|
|
51
|
+
)
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
(define-public (add-minter (minter principal))
|
|
55
|
+
(begin
|
|
56
|
+
(asserts! (is-eq tx-sender contract-owner) err-owner-only)
|
|
57
|
+
(ok (map-set approved-minters minter true))
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
(define-public (ping-133)
|
|
62
|
+
(ok true))
|
|
63
|
+
|
|
64
|
+
(define-public (ping-40)
|
|
65
|
+
(ok true))
|
|
66
|
+
|
|
67
|
+
(define-public (ping-14)
|
|
68
|
+
(ok true))
|
|
69
|
+
|
|
70
|
+
(define-public (ping-2)
|
|
71
|
+
(ok true))
|
|
72
|
+
|
|
73
|
+
(define-public (ping-27)
|
|
74
|
+
(ok true))
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
(define-fungible-token one)
|
|
2
|
+
|
|
3
|
+
(define-constant contract-owner tx-sender)
|
|
4
|
+
(define-constant err-owner-only (err u100))
|
|
5
|
+
(define-constant err-not-authorized (err u101))
|
|
6
|
+
|
|
7
|
+
(define-map approved-minters principal bool)
|
|
8
|
+
|
|
9
|
+
(define-read-only (get-balance (who principal))
|
|
10
|
+
(ok (ft-get-balance one who))
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
(define-read-only (get-total-supply)
|
|
14
|
+
(ok (ft-get-supply one))
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
(define-public (transfer (amount uint) (sender principal) (recipient principal))
|
|
18
|
+
(begin
|
|
19
|
+
(asserts! (is-eq tx-sender sender) err-not-authorized)
|
|
20
|
+
(ft-transfer? one amount sender recipient)
|
|
21
|
+
)
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
(define-public (mint (amount uint) (recipient principal))
|
|
25
|
+
(let
|
|
26
|
+
(
|
|
27
|
+
(is-approved (default-to false (map-get? approved-minters tx-sender)))
|
|
28
|
+
)
|
|
29
|
+
(asserts! (or (is-eq tx-sender contract-owner) is-approved) err-not-authorized)
|
|
30
|
+
(ft-mint? one amount recipient)
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
(define-public (add-minter (minter principal))
|
|
35
|
+
(begin
|
|
36
|
+
(asserts! (is-eq tx-sender contract-owner) err-owner-only)
|
|
37
|
+
(ok (map-set approved-minters minter true))
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
(define-public (ping-114)
|
|
42
|
+
(ok true))
|
|
43
|
+
|
|
44
|
+
(define-public (ping-77)
|
|
45
|
+
(ok true))
|
|
46
|
+
|
|
47
|
+
(define-public (ping-190)
|
|
48
|
+
(ok true))
|
|
49
|
+
|
|
50
|
+
(define-public (ping-77)
|
|
51
|
+
(ok true))
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
;; token-one-v5.clar
|
|
2
|
+
;; @version 2
|
|
3
|
+
|
|
4
|
+
(define-fungible-token one)
|
|
5
|
+
|
|
6
|
+
(define-constant contract-owner tx-sender)
|
|
7
|
+
(define-constant err-owner-only (err u100))
|
|
8
|
+
(define-constant err-not-authorized (err u101))
|
|
9
|
+
|
|
10
|
+
(define-map approved-minters principal bool)
|
|
11
|
+
|
|
12
|
+
;; Standard SIP-010 Functions
|
|
13
|
+
(define-read-only (get-name) (ok "StacksOne Token"))
|
|
14
|
+
(define-read-only (get-symbol) (ok "ONE"))
|
|
15
|
+
(define-read-only (get-decimals) (ok u6))
|
|
16
|
+
(define-read-only (get-token-uri) (ok none))
|
|
17
|
+
|
|
18
|
+
(define-read-only (get-balance (who principal))
|
|
19
|
+
(ok (ft-get-balance one who))
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
(define-read-only (get-total-supply)
|
|
23
|
+
(ok (ft-get-supply one))
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
(define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 34))))
|
|
27
|
+
(begin
|
|
28
|
+
(asserts! (is-eq tx-sender sender) err-not-authorized)
|
|
29
|
+
(try! (ft-transfer? one amount sender recipient))
|
|
30
|
+
(match memo to-print (print to-print) 0)
|
|
31
|
+
(ok true)
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
(define-public (mint (amount uint) (recipient principal))
|
|
36
|
+
(let
|
|
37
|
+
(
|
|
38
|
+
(is-approved (default-to false (map-get? approved-minters tx-sender)))
|
|
39
|
+
)
|
|
40
|
+
;; Tx-sender di sini akan menjadi alamat kontrak Faucet/Staking jika dipanggil via as-contract
|
|
41
|
+
(asserts! (or (is-eq tx-sender contract-owner) is-approved) err-not-authorized)
|
|
42
|
+
(ft-mint? one amount recipient)
|
|
43
|
+
)
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
(define-public (add-minter (minter principal))
|
|
47
|
+
(begin
|
|
48
|
+
(asserts! (is-eq tx-sender contract-owner) err-owner-only)
|
|
49
|
+
(ok (map-set approved-minters minter true))
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
(define-public (ping-142)
|
|
54
|
+
(ok true))
|
|
55
|
+
|
|
56
|
+
(define-public (ping-122)
|
|
57
|
+
(ok true))
|
|
58
|
+
|
|
59
|
+
(define-public (ping-30)
|
|
60
|
+
(ok true))
|
|
61
|
+
|
|
62
|
+
(define-public (ping-110)
|
|
63
|
+
(ok true))
|
|
64
|
+
|
|
65
|
+
(define-public (ping-27)
|
|
66
|
+
(ok true))
|
|
67
|
+
|
|
68
|
+
(define-public (ping-46)
|
|
69
|
+
(ok true))
|
|
70
|
+
|
|
71
|
+
(define-public (ping-7)
|
|
72
|
+
(ok true))
|
|
73
|
+
|
|
74
|
+
(define-public (ping-127)
|
|
75
|
+
(ok true))
|
|
76
|
+
|
|
77
|
+
(define-public (ping-20)
|
|
78
|
+
(ok true))
|