From 364120cabc1addfa84997a85865dd715340d3de5 Mon Sep 17 00:00:00 2001 From: Exekias Date: Sun, 21 Nov 2021 17:03:14 -0500 Subject: [PATCH] V2 stuff: --- README.md | 14 -------------- hardhat.config.js | 48 ++++++++++++++++++++++------------------------- 2 files changed, 22 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 846693f..9af4bb8 100644 --- a/README.md +++ b/README.md @@ -22,20 +22,6 @@ You can also filter by version, test name, etc.: yarn test:unit --grep "ProxyPaymentAddressManager" ``` -## Deploy - -Juicebox uses the [Hardhat Deploy](https://github.com/wighawag/hardhat-deploy) plugin to deploy contracts to a given network. But before using it, you must create a `./mnemonic.txt` file containing the mnemonic phrase of the wallet used to deploy. You can generate a new mnemonic using [this tool](https://github.com/itinance/mnemonics). Generate a mnemonic at your own risk. - -Then, to execute the `./deploy/deploy.js` script, run the following: - -```bash -npx hardhat deploy --network $network -``` - -Contract artifacts will be outputted to `./deployments/$network/**` and should be checked in to the repo. - -> **_NOTE:_** Since we make heavy use of the `skipIfAlreadyDeployed` parameter, if new contract(s) are added, their deployment configuration(s) should be added to the `./deploy/deploy.js` script – not a one-off. - ## Verification To verify the contracts on [Etherscan](https://etherscan.io), make sure you have an `ETHERSCAN_API_KEY` set in your `./.env` file. Then run the following: diff --git a/hardhat.config.js b/hardhat.config.js index 5625e6f..9dba7ec 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -106,36 +106,32 @@ task('account', 'Get balance informations for the deployment account.', async (_ } }); -task("compile:one", "Compiles a single contract in isolation") - .addPositionalParam("contractName") - .setAction(async function(args, env) { +task('compile:one', 'Compiles a single contract in isolation') + .addPositionalParam('contractName') + .setAction(async function (args, env) { + const sourceName = env.artifacts.readArtifactSync(args.contractName).sourceName; - const sourceName = env.artifacts.readArtifactSync(args.contractName).sourceName; - - const dependencyGraph = await env.run( - taskNames.TASK_COMPILE_SOLIDITY_GET_DEPENDENCY_GRAPH, - { sourceNames: [sourceName] } - ); + const dependencyGraph = await env.run(taskNames.TASK_COMPILE_SOLIDITY_GET_DEPENDENCY_GRAPH, { + sourceNames: [sourceName], + }); - const resolvedFiles = dependencyGraph - .getResolvedFiles() - .filter(resolvedFile => { + const resolvedFiles = dependencyGraph.getResolvedFiles().filter((resolvedFile) => { return resolvedFile.sourceName === sourceName; }); - const compilationJob = await env.run( - taskNames.TASK_COMPILE_SOLIDITY_GET_COMPILATION_JOB_FOR_FILE, - { - dependencyGraph, - file: resolvedFiles[0], - } - ); + const compilationJob = await env.run( + taskNames.TASK_COMPILE_SOLIDITY_GET_COMPILATION_JOB_FOR_FILE, + { + dependencyGraph, + file: resolvedFiles[0], + }, + ); - await env.run(taskNames.TASK_COMPILE_SOLIDITY_COMPILE_JOB, { - compilationJob, - compilationJobs: [compilationJob], - compilationJobIndex: 0, - emitsArtifacts: true, - quiet: true, + await env.run(taskNames.TASK_COMPILE_SOLIDITY_COMPILE_JOB, { + compilationJob, + compilationJobs: [compilationJob], + compilationJobIndex: 0, + emitsArtifacts: true, + quiet: true, + }); }); -}); \ No newline at end of file