aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/utils/artifact_writer.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-10-04 07:21:17 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-10-16 04:36:59 +0800
commit3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd (patch)
tree15d4c7df95fd96d6aedb712738cd18bfb213b1f1 /packages/migrations/src/utils/artifact_writer.ts
parent2aa73fc83962d421eae4447108a07a5d952b569d (diff)
downloaddexon-sol-tools-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar
dexon-sol-tools-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.gz
dexon-sol-tools-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.bz2
dexon-sol-tools-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.lz
dexon-sol-tools-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.xz
dexon-sol-tools-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.tar.zst
dexon-sol-tools-3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd.zip
Remove artifacts from migrations package and update contract-wrappers accordingly
Diffstat (limited to 'packages/migrations/src/utils/artifact_writer.ts')
-rw-r--r--packages/migrations/src/utils/artifact_writer.ts26
1 files changed, 0 insertions, 26 deletions
diff --git a/packages/migrations/src/utils/artifact_writer.ts b/packages/migrations/src/utils/artifact_writer.ts
deleted file mode 100644
index ea9c7952d..000000000
--- a/packages/migrations/src/utils/artifact_writer.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { BaseContract } from '@0xproject/base-contract';
-import { ContractArtifact } from 'ethereum-types';
-import * as fs from 'fs';
-import * as path from 'path';
-
-export class ArtifactWriter {
- private readonly _artifactsDir: string;
- private readonly _networkId: number;
- constructor(artifactsDir: string, networkId: number) {
- this._artifactsDir = artifactsDir;
- this._networkId = networkId;
- }
- // This updates the artifact file but does not update the `artifacts` module above. It will not
- // contain the saved artifact changes.
- public saveArtifact(contract: BaseContract): void {
- const contractName = contract.contractName;
- const artifactFile = path.join(this._artifactsDir, `${contractName}.json`);
- const artifact: ContractArtifact = JSON.parse(fs.readFileSync(artifactFile).toString());
- artifact.networks[this._networkId] = {
- address: contract.address,
- links: {},
- constructorArgs: JSON.stringify(contract.constructorArgs),
- };
- fs.writeFileSync(artifactFile, JSON.stringify(artifact, null, '\t'));
- }
-}