package.json 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. {
  2. "name": "solidity-typescript-hardhat-template",
  3. "version": "1.0.0",
  4. "description": "Basic Hardhat template to get you started with Solidity and TypeScript",
  5. "scripts": {
  6. "# ===== 开发工具 ===== #": "",
  7. "compile": "hardhat compile",
  8. "test": "hardhat test",
  9. "coverage": "hardhat coverage",
  10. "node": "hardhat node",
  11. "format:check": "prettier --check .",
  12. "format:write": "prettier --write .",
  13. "lint:check": "eslint .",
  14. "lint:fix": "eslint --fix .",
  15. "sol:format:check": "prettier --check --plugin=prettier-plugin-solidity 'contracts/**/*.sol'",
  16. "sol:format:write": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol'",
  17. "solhint": "solhint -f table 'contracts/**/*.sol'",
  18. "": "",
  19. "# ===== Ignition 部署 ===== #": "",
  20. "deploy": "hardhat ignition deploy",
  21. "deploy:local": "npx hardhat ignition deploy ignition/modules/LaunchpadModule.ts --network localhost --reset",
  22. "deploy:sepolia": "npx hardhat ignition deploy ignition/modules/LaunchpadModule.ts --network sepolia",
  23. "visualize": "npx hardhat ignition visualize ignition/modules/LaunchpadModule.ts",
  24. "": "",
  25. "# ===== 多环境统一调用 ===== #": "",
  26. "env": "npx ts-node scripts/run-with-env.ts",
  27. "env:help": "npx ts-node scripts/run-with-env.ts --help",
  28. "env:quick-help": "echo '多环境调用方式: npm run env <environment> <script>' && echo '例如: npm run env hardhat 01:deploy' && echo '例如: npm run env bsctest 03:init' && echo '例如: npm run env bscmainnet 01:deploy'",
  29. "": "",
  30. "# ===== 传统调用方式 (保留兼容性) ===== #": "",
  31. "01:deploy": "npx ts-node scripts/01-deploy-contracts.ts",
  32. "02:distribute": "npx ts-node scripts/02-distribute-tokens.ts",
  33. "03:init": "npx ts-node scripts/03-init-sale.ts",
  34. "04:contribute-undersubscribed": "npx ts-node scripts/04-test-contributions.ts",
  35. "04:contribute-oversubscribed": "SCENARIO=1 npx ts-node scripts/04-test-contributions.ts",
  36. "05:claim": "npx ts-node scripts/05-test-claiming.ts",
  37. "": "",
  38. "# ===== 快捷流程 ===== #": "",
  39. "test:hardhat": "npm run env hardhat 01:deploy && npm run env hardhat 02:distribute && npm run env hardhat 03:init && npm run env hardhat 04:contribute && npm run env hardhat 05:claim",
  40. "test:bsctest": "npm run env bsctest 01:deploy && npm run env bsctest 02:distribute && npm run env bsctest 03:init && npm run env bsctest 04:contribute && npm run env bsctest 05:claim",
  41. "test:bscmainnet": "npm run env bscmainnet 01:deploy && npm run env bscmainnet 02:distribute && npm run env bscmainnet 03:init && npm run env bscmainnet 04:contribute && npm run env bscmainnet 05:claim",
  42. "test:undersubscribed": "npm run 01:deploy && npm run 02:distribute && npm run 03:init && npm run 04:contribute-undersubscribed && npm run 05:claim",
  43. "test:oversubscribed": "npm run 01:deploy && npm run 02:distribute && npm run 03:init && npm run 04:contribute-oversubscribed && npm run 05:claim",
  44. "": "",
  45. "# ===== 简化命令 ===== #": "",
  46. "04:contribute": "npm run 04:contribute-undersubscribed",
  47. "04:contribute:over": "npm run 04:contribute-oversubscribed",
  48. "": "",
  49. "# ===== 独立工具 ===== #": "",
  50. "deploy:legacy": "npx ts-node scripts/deploy-bsctest.ts",
  51. "set-merkle": "npx ts-node scripts/set-merkle-root.ts",
  52. "": "",
  53. "# ===== 帮助信息 ===== #": "",
  54. "help": "echo '🚀 多环境统一调用方式:' && echo 'npm run env <environment> <script>' && echo '' && echo '🌍 可用环境:' && echo ' hardhat - Hardhat本地环境' && echo ' bsctest - BSC测试网环境' && echo ' bscmainnet - BNB主网环境' && echo '' && echo '📜 可用脚本:' && echo ' 01:deploy - 部署合约' && echo ' 02:distribute - 分发代币' && echo ' 03:init - 初始化销售' && echo ' 04:contribute - 测试贡献' && echo ' 05:claim - 测试领取' && echo '' && echo '💡 示例:' && echo ' npm run env hardhat 01:deploy' && echo ' npm run env bsctest 03:init' && echo ' npm run env bscmainnet 01:deploy' && echo '' && echo '🚀 快捷流程:' && echo ' npm run test:hardhat - Hardhat环境完整测试' && echo ' npm run test:bsctest - BSC测试网完整测试' && echo ' npm run test:bscmainnet - BNB主网完整测试'"
  55. },
  56. "license": "MIT",
  57. "dependencies": {
  58. "@openzeppelin/contracts": "^5.3.0",
  59. "@openzeppelin/merkle-tree": "^1.0.8",
  60. "@prb/math": "^4.1.0",
  61. "abdk-libraries-solidity": "^3.2.0",
  62. "prb-math": "^2.4.3"
  63. },
  64. "devDependencies": {
  65. "@eslint/eslintrc": "^3.3.1",
  66. "@eslint/js": "^9.30.0",
  67. "@nomicfoundation/hardhat-toolbox": "^6.0.0",
  68. "@nomiclabs/hardhat-solhint": "^4.0.2",
  69. "@openzeppelin/test-helpers": "^0.5.16",
  70. "@types/node": "^22.15.34",
  71. "@typescript-eslint/eslint-plugin": "^8.35.0",
  72. "@typescript-eslint/parser": "^8.35.0",
  73. "dotenv": "^17.0.0",
  74. "eslint": "^9.30.0",
  75. "eslint-config-prettier": "^10.1.5",
  76. "eslint-plugin-prettier": "^5.5.1",
  77. "ethers": "^6.14.4",
  78. "hardhat": "^2.25.0",
  79. "prettier": "^3.6.2",
  80. "prettier-plugin-solidity": "^2.0.0",
  81. "solhint": "^5.2.0",
  82. "solidity-coverage": "^0.8.16",
  83. "typescript": "^5.8.3"
  84. }
  85. }