[Contract Development Tool] Erstellen Sie ein neues Solidity-Projekt basierend auf Hardhat

Hier ist das Zitat

Installieren

  • Erstellen Sie ein neues npm-Projekt
npm init
  • Erstellen Sie ein neues Hardhat-Projekt
npm install --save-dev hardhat
npx hardhat
  • Typoskript-Unterstützung hinzufügen
npm install --save-dev ts-node typescript
npm install --save-dev chai @types/node @types/mocha @types/chai
  • Fügen Sie notwendige Elemente hinzu
mv hardhat.config.js hardhat.config.ts
  • Fügen Sie gängige Plugins hinzu
    npm install -D hardhat-deploy
    npm install --save-dev @nomiclabs/hardhat-ethers 'ethers@^5.0.0'
    npm install --save-dev @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers
    npm install hardhat-gas-reporter --save-dev
  • Erstellen Sie eine neue tsconfig.json,
    um Inhalte gemäß den Anforderungen des Projekts zu schreiben, zum Beispiel:
{
    "compilerOptions": {
      "module": "commonjs",
      "target": "es5",
      "sourceMap": true,
      "strict": true,
      "esModuleInterop": true,
      "moduleResolution": "node",
      "forceConsistentCasingInFileNames": true,
      "outDir": "dist"
    },
    "include": [
      "hardhat.config.ts",
      "./deploy",
      "./test"
    ],
    "exclude": [
      "node_modules"
    ]
}

Einzelheiten finden Sie unter:
https://typescript.bootcss.com/tsconfig-json.html

Supongo que te gusta

Origin blog.csdn.net/weixin_43742184/article/details/118052858
Recomendado
Clasificación