Skip to content

Commit

Permalink
V2 stuff:
Browse files Browse the repository at this point in the history
  • Loading branch information
odd-amphora committed Nov 21, 2021
1 parent 05828d5 commit 364120c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 40 deletions.
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
48 changes: 22 additions & 26 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
});

0 comments on commit 364120c

Please sign in to comment.