appease CI
This commit is contained in:
parent
b10522479c
commit
2c73bbd689
@ -121,6 +121,7 @@ describe('swapQuoteConsumerUtils', () => {
|
|||||||
|
|
||||||
swapQuoteConsumer = new SwapQuoteConsumer(provider, {
|
swapQuoteConsumer = new SwapQuoteConsumer(provider, {
|
||||||
chainId,
|
chainId,
|
||||||
|
contractAddresses,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -15,9 +15,9 @@ import {
|
|||||||
} from '@0x/contracts-coordinator';
|
} from '@0x/contracts-coordinator';
|
||||||
import { artifacts as devUtilsArtifacts, DevUtilsContract } from '@0x/contracts-dev-utils';
|
import { artifacts as devUtilsArtifacts, DevUtilsContract } from '@0x/contracts-dev-utils';
|
||||||
import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155';
|
import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155';
|
||||||
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
|
import { artifacts as erc20Artifacts, DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20';
|
||||||
import { artifacts as erc20BridgeSamplerArtifacts } from '@0x/contracts-erc20-bridge-sampler';
|
import { artifacts as erc20BridgeSamplerArtifacts } from '@0x/contracts-erc20-bridge-sampler';
|
||||||
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
|
import { artifacts as erc721Artifacts, DummyERC721TokenContract } from '@0x/contracts-erc721';
|
||||||
import { artifacts as exchangeArtifacts, ExchangeContract } from '@0x/contracts-exchange';
|
import { artifacts as exchangeArtifacts, ExchangeContract } from '@0x/contracts-exchange';
|
||||||
import { artifacts as forwarderArtifacts, ForwarderContract } from '@0x/contracts-exchange-forwarder';
|
import { artifacts as forwarderArtifacts, ForwarderContract } from '@0x/contracts-exchange-forwarder';
|
||||||
import {
|
import {
|
||||||
@ -42,6 +42,7 @@ import { BigNumber, providerUtils } from '@0x/utils';
|
|||||||
import { SupportedProvider, TxData } from 'ethereum-types';
|
import { SupportedProvider, TxData } from 'ethereum-types';
|
||||||
|
|
||||||
import { constants } from './utils/constants';
|
import { constants } from './utils/constants';
|
||||||
|
import { erc20TokenInfo, erc721TokenInfo } from './utils/token_info';
|
||||||
|
|
||||||
const allArtifacts = {
|
const allArtifacts = {
|
||||||
...assetProxyArtifacts,
|
...assetProxyArtifacts,
|
||||||
@ -119,7 +120,28 @@ export async function runMigrationsAsync(
|
|||||||
): Promise<ContractAddresses> {
|
): Promise<ContractAddresses> {
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const chainId = new BigNumber(await providerUtils.getChainIdAsync(provider));
|
const chainId = new BigNumber(await providerUtils.getChainIdAsync(provider));
|
||||||
const { exchangeV2, etherToken, zrxToken } = getContractAddressesForChainOrThrow(chainId.toNumber());
|
const { exchangeV2 } = getContractAddressesForChainOrThrow(chainId.toNumber());
|
||||||
|
|
||||||
|
const zrxToken = await DummyERC20TokenContract.deployFrom0xArtifactAsync(
|
||||||
|
erc20Artifacts.DummyERC20Token,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
allArtifacts,
|
||||||
|
'0x Protocol Token',
|
||||||
|
'ZRX',
|
||||||
|
new BigNumber(18),
|
||||||
|
new BigNumber(1000000000000000000000000000),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Ether token
|
||||||
|
const etherToken = await WETH9Contract.deployFrom0xArtifactAsync(
|
||||||
|
erc20Artifacts.WETH9,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
allArtifacts,
|
||||||
|
);
|
||||||
|
|
||||||
|
await _migrateDummyTokensAsync(provider, txDefaults);
|
||||||
|
|
||||||
// Exchange
|
// Exchange
|
||||||
const exchange = await ExchangeContract.deployFrom0xArtifactAsync(
|
const exchange = await ExchangeContract.deployFrom0xArtifactAsync(
|
||||||
@ -130,18 +152,6 @@ export async function runMigrationsAsync(
|
|||||||
chainId,
|
chainId,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Dev Utils
|
|
||||||
const devUtils = await DevUtilsContract.deployWithLibrariesFrom0xArtifactAsync(
|
|
||||||
devUtilsArtifacts.DevUtils,
|
|
||||||
devUtilsArtifacts,
|
|
||||||
provider,
|
|
||||||
txDefaults,
|
|
||||||
allArtifacts,
|
|
||||||
exchange.address,
|
|
||||||
NULL_ADDRESS,
|
|
||||||
NULL_ADDRESS,
|
|
||||||
);
|
|
||||||
|
|
||||||
// CoordinatorRegistry
|
// CoordinatorRegistry
|
||||||
const coordinatorRegistry = await CoordinatorRegistryContract.deployFrom0xArtifactAsync(
|
const coordinatorRegistry = await CoordinatorRegistryContract.deployFrom0xArtifactAsync(
|
||||||
coordinatorArtifacts.CoordinatorRegistry,
|
coordinatorArtifacts.CoordinatorRegistry,
|
||||||
@ -169,11 +179,23 @@ export async function runMigrationsAsync(
|
|||||||
erc20BridgeProxy,
|
erc20BridgeProxy,
|
||||||
] = await _migrateAssetProxiesAsync(exchange, provider, txDefaults);
|
] = await _migrateAssetProxiesAsync(exchange, provider, txDefaults);
|
||||||
|
|
||||||
|
// Dev Utils
|
||||||
|
const devUtils = await DevUtilsContract.deployWithLibrariesFrom0xArtifactAsync(
|
||||||
|
devUtilsArtifacts.DevUtils,
|
||||||
|
devUtilsArtifacts,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
allArtifacts,
|
||||||
|
exchange.address,
|
||||||
|
NULL_ADDRESS,
|
||||||
|
NULL_ADDRESS,
|
||||||
|
);
|
||||||
|
|
||||||
const [zrxVault, stakingLogic, stakingProxy] = await _migrateStakingAsync(
|
const [zrxVault, stakingLogic, stakingProxy] = await _migrateStakingAsync(
|
||||||
exchange,
|
exchange,
|
||||||
erc20Proxy,
|
erc20Proxy,
|
||||||
zrxToken,
|
zrxToken.address,
|
||||||
etherToken,
|
etherToken.address,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
);
|
);
|
||||||
@ -188,7 +210,7 @@ export async function runMigrationsAsync(
|
|||||||
allArtifacts,
|
allArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
exchangeV2,
|
exchangeV2,
|
||||||
etherToken,
|
etherToken.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
@ -199,15 +221,15 @@ export async function runMigrationsAsync(
|
|||||||
affiliateFeeTransformer,
|
affiliateFeeTransformer,
|
||||||
exchangeProxyFlashWalletAddress,
|
exchangeProxyFlashWalletAddress,
|
||||||
exchangeProxyAllowanceTargetAddress,
|
exchangeProxyAllowanceTargetAddress,
|
||||||
] = await _migrateExchangeProxyAsync(exchange, etherToken, provider, txDefaults);
|
] = await _migrateExchangeProxyAsync(exchange, etherToken.address, provider, txDefaults);
|
||||||
|
|
||||||
const contractAddresses = {
|
const contractAddresses = {
|
||||||
...NULL_ADDRESSES,
|
...NULL_ADDRESSES,
|
||||||
erc20Proxy: erc20Proxy.address,
|
erc20Proxy: erc20Proxy.address,
|
||||||
erc721Proxy: erc721Proxy.address,
|
erc721Proxy: erc721Proxy.address,
|
||||||
erc1155Proxy: erc1155Proxy.address,
|
erc1155Proxy: erc1155Proxy.address,
|
||||||
zrxToken,
|
zrxToken: zrxToken.address,
|
||||||
etherToken,
|
etherToken: etherToken.address,
|
||||||
exchange: exchange.address,
|
exchange: exchange.address,
|
||||||
erc20BridgeProxy: erc20BridgeProxy.address,
|
erc20BridgeProxy: erc20BridgeProxy.address,
|
||||||
forwarder: forwarder.address,
|
forwarder: forwarder.address,
|
||||||
@ -216,7 +238,6 @@ export async function runMigrationsAsync(
|
|||||||
multiAssetProxy: multiAssetProxy.address,
|
multiAssetProxy: multiAssetProxy.address,
|
||||||
staticCallProxy: staticCallProxy.address,
|
staticCallProxy: staticCallProxy.address,
|
||||||
devUtils: devUtils.address,
|
devUtils: devUtils.address,
|
||||||
exchangeV2: exchangeV2,
|
|
||||||
zrxVault: zrxVault.address,
|
zrxVault: zrxVault.address,
|
||||||
staking: stakingLogic.address,
|
staking: stakingLogic.address,
|
||||||
stakingProxy: stakingProxy.address,
|
stakingProxy: stakingProxy.address,
|
||||||
@ -439,6 +460,33 @@ async function _migrateExchangeProxyAsync(
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function _migrateDummyTokensAsync(provider: ZeroExProvider, txDefaults: TxData): Promise<void> {
|
||||||
|
// Dummy ERC20 tokens
|
||||||
|
for (const token of erc20TokenInfo) {
|
||||||
|
const totalSupply = new BigNumber(1000000000000000000000000000);
|
||||||
|
await DummyERC20TokenContract.deployFrom0xArtifactAsync(
|
||||||
|
erc20Artifacts.DummyERC20Token,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
allArtifacts,
|
||||||
|
token.name,
|
||||||
|
token.symbol,
|
||||||
|
token.decimals,
|
||||||
|
totalSupply,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dummy ERC721 token
|
||||||
|
await DummyERC721TokenContract.deployFrom0xArtifactAsync(
|
||||||
|
erc721Artifacts.DummyERC721Token,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
allArtifacts,
|
||||||
|
erc721TokenInfo[0].name,
|
||||||
|
erc721TokenInfo[0].symbol,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
let _cachedContractAddresses: ContractAddresses;
|
let _cachedContractAddresses: ContractAddresses;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -459,3 +507,4 @@ export async function runMigrationsOnceAsync(
|
|||||||
_cachedContractAddresses = await runMigrationsAsync(provider, txDefaults);
|
_cachedContractAddresses = await runMigrationsAsync(provider, txDefaults);
|
||||||
return _cachedContractAddresses;
|
return _cachedContractAddresses;
|
||||||
}
|
}
|
||||||
|
// tslint:disable-next-line: max-file-line-count
|
||||||
|
Loading…
x
Reference in New Issue
Block a user