Update contract wrappers (esp Forwarder + asset-swapper) (#2432)

* `@0x/contract-artifacts`: Update artifacts.

* `@0x/contract-wrappers`: Regenerate wrappers.

* `@0x/migrations`: Update Forwarder migration.

* `@0x/asset-swapper`: Update forwarder fees for new forwarder contract.

* `@0x/dev-utils`: Make `"istanbul"` the default `hardfork` when creating a ganache provider.

* `@0x/asset-swapper`: Remove debug code.

* `@0x/asset-swapper`: Remove `getSmartContractParamsOrThrowAsync()` because why does it even exist?
`@0x/asset-swapper`: Fix broken tests.
`@0x/asset-swapper`: Correctly handle affiliate fees in `getCalldataOrThrow()`.

* `@0x/contract-wrappers`: Export `ExchangeOwnershipTransferredEventArgs`.
`@0x/0x.js`: Export `ExchangeOwnershipTransferredEventArgs`.
`@0x/asset-swapper`: Unexport `MethodAbi`, `ConstructorStateMutability`, and `StateMutability`.

* Update changelogs

* Update packages/migrations/CHANGELOG.json

Co-Authored-By: Jacob Evans <jacob@dekz.net>

* Update packages/asset-swapper/CHANGELOG.json

Co-Authored-By: Jacob Evans <jacob@dekz.net>

Co-authored-by: Lawrence Forman <me@merklejerk.com>
Co-authored-by: Jacob Evans <dekz@dekz.net>
This commit is contained in:
Lawrence Forman
2020-01-09 15:35:22 -05:00
committed by GitHub
parent 726ea5e01e
commit 71731d223b
52 changed files with 1553 additions and 1642 deletions

View File

@@ -1,4 +1,4 @@
import { ContractAddresses } from '@0x/contract-addresses';
import { ContractAddresses, getContractAddressesForChainOrThrow } from '@0x/contract-addresses';
import * as artifacts from '@0x/contract-artifacts';
import { ForwarderContract } from '@0x/contract-wrappers';
import {
@@ -15,7 +15,12 @@ import { ERC1155MintableContract } from '@0x/contracts-erc1155';
import { DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20';
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
import { ExchangeContract } from '@0x/contracts-exchange';
import { StakingProxyContract, TestStakingContract, ZrxVaultContract } from '@0x/contracts-staking';
import {
artifacts as stakingArtifacts,
StakingProxyContract,
TestStakingContract,
ZrxVaultContract,
} from '@0x/contracts-staking';
import { Web3ProviderEngine } from '@0x/subproviders';
import { BigNumber, providerUtils } from '@0x/utils';
import { SupportedProvider, TxData } from 'ethereum-types';
@@ -204,7 +209,7 @@ export async function runMigrationsAsync(
// Note we use TestStakingContract as the deployed bytecode of a StakingContract
// has the tokens hardcoded
const stakingLogic = await TestStakingContract.deployFrom0xArtifactAsync(
artifacts.Staking,
stakingArtifacts.TestStaking,
provider,
txDefaults,
{},
@@ -237,12 +242,14 @@ export async function runMigrationsAsync(
// Forwarder
// Deployed after Exchange and Staking is configured as it queries
// in the constructor
const { exchangeV2: exchangeV2Address } = getContractAddressesForChainOrThrow(chainId.toNumber());
const forwarder = await ForwarderContract.deployFrom0xArtifactAsync(
artifacts.Forwarder,
provider,
txDefaults,
artifacts,
exchange.address,
exchangeV2Address || constants.NULL_ADDRESS,
etherToken.address,
);
@@ -257,12 +264,14 @@ export async function runMigrationsAsync(
erc20BridgeProxy: erc20BridgeProxy.address,
zeroExGovernor: constants.NULL_ADDRESS,
forwarder: forwarder.address,
orderValidator: constants.NULL_ADDRESS,
dutchAuction: constants.NULL_ADDRESS,
coordinatorRegistry: coordinatorRegistry.address,
coordinator: coordinator.address,
multiAssetProxy: multiAssetProxy.address,
staticCallProxy: staticCallProxy.address,
devUtils: devUtils.address,
exchangeV2: exchange.address,
exchangeV2: exchangeV2Address || constants.NULL_ADDRESS,
zrxVault: zrxVault.address,
staking: stakingLogic.address,
stakingProxy: stakingProxy.address,