diff options
author | Fabio Berger <me@fabioberger.com> | 2018-04-04 15:33:18 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-04-04 15:33:18 +0800 |
commit | 3e648cfb7ec20f9e5b0160dbc55c78277e9d56cc (patch) | |
tree | ffd931f7d82a12e64e3b3b1ce86c1225aa168c5e /packages | |
parent | 2106d7476d40288bf2be91ade17673637cb6f223 (diff) | |
download | dexon-sol-tools-3e648cfb7ec20f9e5b0160dbc55c78277e9d56cc.tar dexon-sol-tools-3e648cfb7ec20f9e5b0160dbc55c78277e9d56cc.tar.gz dexon-sol-tools-3e648cfb7ec20f9e5b0160dbc55c78277e9d56cc.tar.bz2 dexon-sol-tools-3e648cfb7ec20f9e5b0160dbc55c78277e9d56cc.tar.lz dexon-sol-tools-3e648cfb7ec20f9e5b0160dbc55c78277e9d56cc.tar.xz dexon-sol-tools-3e648cfb7ec20f9e5b0160dbc55c78277e9d56cc.tar.zst dexon-sol-tools-3e648cfb7ec20f9e5b0160dbc55c78277e9d56cc.zip |
Move migrations over from contracts to 0x.js
Diffstat (limited to 'packages')
-rw-r--r-- | packages/0x.js/test/migrations/config/token_info.ts (renamed from packages/contracts/migrations/config/token_info.ts) | 2 | ||||
-rw-r--r-- | packages/0x.js/test/migrations/migrate.ts (renamed from packages/contracts/migrations/migrate.ts) | 6 | ||||
-rw-r--r-- | packages/0x.js/test/migrations/types.ts | 38 | ||||
-rw-r--r-- | packages/contracts/migrations/config/multisig_sample.ts | 10 | ||||
-rw-r--r-- | packages/contracts/migrations/index.ts | 20 | ||||
-rw-r--r-- | packages/contracts/migrations/types.ts | 23 | ||||
-rw-r--r-- | packages/contracts/package.json | 1 |
7 files changed, 42 insertions, 58 deletions
diff --git a/packages/contracts/migrations/config/token_info.ts b/packages/0x.js/test/migrations/config/token_info.ts index 5fd3db144..0d0e90917 100644 --- a/packages/contracts/migrations/config/token_info.ts +++ b/packages/0x.js/test/migrations/config/token_info.ts @@ -1,4 +1,4 @@ -import { constants } from '../../util/constants'; +import { constants } from '../../utils/constants'; import { Token } from '../types'; export const tokenInfo: Token[] = [ diff --git a/packages/contracts/migrations/migrate.ts b/packages/0x.js/test/migrations/migrate.ts index cff8af0ab..85fb2a34f 100644 --- a/packages/contracts/migrations/migrate.ts +++ b/packages/0x.js/test/migrations/migrate.ts @@ -3,10 +3,10 @@ import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; -import { constants } from '../util/constants'; -import { ContractName } from '../util/types'; +import { constants } from '../utils/constants'; import { tokenInfo } from './config/token_info'; +import { ContractName } from './types'; /** * Custom migrations should be defined in this function. This will be called with the CLI 'migrate' command. @@ -20,7 +20,7 @@ export const runMigrationsAsync = async (deployer: Deployer) => { const tokenTransferProxy = await deployer.deployAndSaveAsync(ContractName.TokenTransferProxy); const zrxToken = await deployer.deployAndSaveAsync(ContractName.ZRXToken); - const etherToken = await deployer.deployAndSaveAsync(ContractName.EtherToken); + const etherToken = await deployer.deployAndSaveAsync(ContractName.WETH9); const tokenReg = await deployer.deployAndSaveAsync(ContractName.TokenRegistry); const exchangeArgs = [zrxToken.address, tokenTransferProxy.address]; diff --git a/packages/0x.js/test/migrations/types.ts b/packages/0x.js/test/migrations/types.ts new file mode 100644 index 000000000..1887bfd96 --- /dev/null +++ b/packages/0x.js/test/migrations/types.ts @@ -0,0 +1,38 @@ +export interface MultiSigConfig { + owners: string[]; + confirmationsRequired: number; + secondsRequired: number; +} + +export interface MultiSigConfigByNetwork { + [networkName: string]: MultiSigConfig; +} + +export interface Token { + address?: string; + name: string; + symbol: string; + decimals: number; + ipfsHash: string; + swarmHash: string; +} + +export interface TokenInfoByNetwork { + development: Token[]; + live: Token[]; +} + +export enum ContractName { + TokenTransferProxy = 'TokenTransferProxy', + TokenRegistry = 'TokenRegistry', + MultiSigWalletWithTimeLock = 'MultiSigWalletWithTimeLock', + Exchange = 'Exchange', + ZRXToken = 'ZRXToken', + DummyToken = 'DummyToken', + WETH9 = 'WETH9', + MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress = 'MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress', + MaliciousToken = 'MaliciousToken', + AccountLevels = 'AccountLevels', + EtherDelta = 'EtherDelta', + Arbitrage = 'Arbitrage', +} diff --git a/packages/contracts/migrations/config/multisig_sample.ts b/packages/contracts/migrations/config/multisig_sample.ts deleted file mode 100644 index bc2502fca..000000000 --- a/packages/contracts/migrations/config/multisig_sample.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { MultiSigConfigByNetwork } from '../types'; - -// Make a copy of this file named `multisig.js` and input custom params as needed -export const multiSig: MultiSigConfigByNetwork = { - kovan: { - owners: [], - confirmationsRequired: 0, - secondsRequired: 0, - }, -}; diff --git a/packages/contracts/migrations/index.ts b/packages/contracts/migrations/index.ts deleted file mode 100644 index 47ae7044d..000000000 --- a/packages/contracts/migrations/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Deployer } from '@0xproject/deployer'; -import { devConstants } from '@0xproject/dev-utils'; -import * as path from 'path'; - -import { constants } from '../util/constants'; - -import { runMigrationsAsync } from './migrate'; - -const deployerOpts = { - artifactsDir: path.resolve('src', 'artifacts'), - jsonrpcUrl: devConstants.RPC_URL, - networkId: constants.TESTRPC_NETWORK_ID, - defaults: { - gas: devConstants.GAS_ESTIMATE, - }, -}; - -export const deployer = new Deployer(deployerOpts); - -runMigrationsAsync(deployer).catch(console.log); diff --git a/packages/contracts/migrations/types.ts b/packages/contracts/migrations/types.ts deleted file mode 100644 index 58d1e5b4f..000000000 --- a/packages/contracts/migrations/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface MultiSigConfig { - owners: string[]; - confirmationsRequired: number; - secondsRequired: number; -} - -export interface MultiSigConfigByNetwork { - [networkName: string]: MultiSigConfig; -} - -export interface Token { - address?: string; - name: string; - symbol: string; - decimals: number; - ipfsHash: string; - swarmHash: string; -} - -export interface TokenInfoByNetwork { - development: Token[]; - live: Token[]; -} diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 8152a9afe..1d393c60b 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -19,7 +19,6 @@ "compile": "node ../deployer/lib/src/cli.js compile --contracts ${npm_package_config_contracts} --contracts-dir src/contracts --artifacts-dir src/artifacts", "clean": "shx rm -rf ./lib", "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", - "migrate": "yarn build && yarn compile && node ./lib/migrations/index.js", "lint": "tslint --project . 'migrations/**/*.ts' 'test/**/*.ts' 'util/**/*.ts' 'deploy/**/*.ts'", "coverage:report:text": "istanbul report text", "coverage:report:html": "istanbul report html && open coverage/index.html", |