Merge pull request #840 from 0xProject/feature/migrations/forwarder-migrations

Add Migrations for Forwarder and miscellaneous fixes
This commit is contained in:
Jacob Evans
2018-07-11 20:59:23 +10:00
committed by GitHub
7 changed files with 35 additions and 17 deletions

View File

@@ -336,15 +336,19 @@ describe('EtherTokenWrapper', () => {
describe('#getLogsAsync', () => {
let etherTokenAddress: string;
let erc20ProxyAddress: string;
const blockRange: BlockRange = {
fromBlock: 0,
toBlock: BlockParamLiteral.Latest,
};
let blockRange: BlockRange;
let txHash: string;
before(() => {
before(async () => {
addressWithETH = userAddresses[0];
etherTokenAddress = tokenUtils.getWethTokenAddress();
erc20ProxyAddress = contractWrappers.erc20Proxy.getContractAddress();
// Start the block range after all migrations to avoid unexpected logs
const currentBlock = await web3Wrapper.getBlockNumberAsync();
const fromBlock = currentBlock + 1;
blockRange = {
fromBlock,
toBlock: BlockParamLiteral.Latest,
};
});
it('should get logs with decoded args emitted by Approval', async () => {
txHash = await contractWrappers.erc20Token.setUnlimitedProxyAllowanceAsync(

View File

@@ -18,7 +18,7 @@
pragma solidity ^0.4.10;
import "../../current/multisig/MultiSigWalletWithTimeLock.sol";
import "../../2.0.0/multisig/MultiSigWalletWithTimeLock.sol";
contract MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress is MultiSigWalletWithTimeLock {
@@ -79,4 +79,4 @@ contract MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress is MultiSigWall
}
return true;
}
}
}

View File

@@ -40,7 +40,6 @@ contract Forwarder is
address _exchange,
address _etherToken,
address _zrxToken,
bytes4 _erc20AssetProxyId,
bytes memory _zrxAssetData,
bytes memory _wethAssetData
)

View File

@@ -1,6 +1,6 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { assetProxyUtils } from '@0xproject/order-utils';
import { AssetProxyId, RevertReason, SignedOrder } from '@0xproject/types';
import { RevertReason, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
@@ -131,7 +131,6 @@ describe(ContractName.Forwarder, () => {
exchangeInstance.address,
wethContract.address,
zrxToken.address,
AssetProxyId.ERC20,
zrxAssetData,
wethAssetData,
);

View File

@@ -708,10 +708,6 @@
"name": "_zrxToken",
"type": "address"
},
{
"name": "_erc20AssetProxyId",
"type": "bytes4"
},
{
"name": "_zrxAssetData",
"type": "bytes"
@@ -896,5 +892,11 @@
}
}
},
"networks": {}
}
"networks": {
"50": {
"address": "0xb69e673309512a9d726f87304c6984054f87a93b",
"links": {},
"constructorArgs": "[\"0x48bacb9266a570d521063ef5dd96e61686dbe788\",\"0x0b1ba0af832d7c05fd64161e0db78e85978e8082\",\"0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\",\"0xf47261b0\",\"0xf47261b0000000000000000000000000871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c\",\"0xf47261b00000000000000000000000000b1ba0af832d7c05fd64161e0db78e85978e8082\"]"
}
}
}

View File

@@ -1,5 +1,5 @@
{
"contractsDir": "../contracts/src/contracts",
"contractsDir": "../contracts/src/",
"compilerSettings": {
"optimizer": {
"enabled": true,

View File

@@ -13,6 +13,7 @@ import { DummyERC721TokenContract } from './contract_wrappers/dummy_erc721_token
import { ERC20ProxyContract } from './contract_wrappers/erc20_proxy';
import { ERC721ProxyContract } from './contract_wrappers/erc721_proxy';
import { ExchangeContract } from './contract_wrappers/exchange';
import { ForwarderContract } from './contract_wrappers/forwarder';
import { WETH9Contract } from './contract_wrappers/weth9';
import { ZRXTokenContract } from './contract_wrappers/zrx_token';
@@ -127,4 +128,17 @@ export const runV2MigrationsAsync = async (provider: Provider, artifactsDir: str
erc721TokenInfo[0].name,
erc721TokenInfo[0].symbol,
);
// Forwarder
const forwarder = await ForwarderContract.deployFrom0xArtifactAsync(
artifacts.Forwarder,
provider,
txDefaults,
exchange.address,
etherToken.address,
zrxToken.address,
assetProxyUtils.encodeERC20AssetData(zrxToken.address),
assetProxyUtils.encodeERC20AssetData(etherToken.address),
);
artifactsWriter.saveArtifact(forwarder);
};