Переглянути джерело

Read optional compiler version from args/envvars (#2810)

Hadrien Croubois 4 роки тому
батько
коміт
48375aa908
1 змінених файлів з 23 додано та 4 видалено
  1. 23 4
      hardhat.config.js

+ 23 - 4
hardhat.config.js

@@ -7,9 +7,28 @@ const fs = require('fs');
 const path = require('path');
 const argv = require('yargs/yargs')()
   .env('')
-  .boolean('enableGasReport')
-  .boolean('ci')
-  .string('compileMode')
+  .options({
+    ci: {
+      type: 'boolean',
+      default: false,
+    },
+    gas: {
+      alias: 'enableGasReport',
+      type: 'boolean',
+      default: false,
+    },
+    mode: {
+      alias: 'compileMode',
+      type: 'string',
+      choices: [ 'production', 'development' ],
+      default: 'development',
+    },
+    compiler: {
+      alias: 'compileVersion',
+      type: 'string',
+      default: '0.8.3',
+    },
+  })
   .argv;
 
 require('@nomiclabs/hardhat-truffle5');
@@ -30,7 +49,7 @@ const withOptimizations = argv.enableGasReport || argv.compileMode === 'producti
  */
 module.exports = {
   solidity: {
-    version: '0.8.3',
+    version: argv.compiler,
     settings: {
       optimizer: {
         enabled: withOptimizations,