blob: 662a2cb0f411b13e205608ec35501c703b4b363d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
import { devConstants } from '@0xproject/dev-utils';
import { ArtifactWriter } from '@0xproject/migrations';
import { BigNumber } from '@0xproject/utils';
import { artifacts } from '../src/artifacts';
import { constants } from '../src/constants';
import { DummyERC20TokenContract } from '../src/generated_contract_wrappers/dummy_e_r_c20_token';
import { ERC20ProxyContract } from '../src/generated_contract_wrappers/e_r_c20_proxy';
import { provider } from './utils/web3_wrapper';
before('migrate contracts', async function(): Promise<void> {
// HACK: Since contract migrations take longer then our global mocha timeout limit
// we manually increase it for this before hook.
const mochaTestTimeoutMs = 20000;
this.timeout(mochaTestTimeoutMs);
const txDefaults = {
gas: devConstants.GAS_LIMIT,
from: devConstants.TESTRPC_FIRST_ADDRESS,
};
const networkId = constants.TESTRPC_NETWORK_ID;
const artifactsDir = `lib/src/artifacts`;
const artifactsWriter = new ArtifactWriter(artifactsDir, networkId);
const erc20proxy = await ERC20ProxyContract.deployFrom0xArtifactAsync(artifacts.ERC20Proxy, provider, txDefaults);
artifactsWriter.saveArtifact(erc20proxy);
const totalSupply = new BigNumber(100000000000000000000);
const name = 'Test';
const symbol = 'TST';
const decimals = new BigNumber(18);
// tslint:disable-next-line:no-unused-variable
const dummyErc20Token = await DummyERC20TokenContract.deployFrom0xArtifactAsync(
artifacts.DummyERC20Token,
provider,
txDefaults,
name,
symbol,
decimals,
totalSupply,
);
artifactsWriter.saveArtifact(dummyErc20Token);
});
|