Skip to content

Commit

Permalink
Read optional compiler version from args/envvars (OpenZeppelin#2810)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx authored Aug 5, 2021
1 parent 29957d4 commit 48375aa
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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,
Expand Down

0 comments on commit 48375aa

Please sign in to comment.