From 89429c54a7424eb6aa233047fa83fe595faa44d5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 11 Jan 2019 18:04:33 +0100 Subject: Updated CHANGELOGS --- packages/migrations/CHANGELOG.json | 9 +++++++++ packages/migrations/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/migrations') diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 5e7c89290..13aca373b 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "2.3.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "2.3.0", "changes": [ diff --git a/packages/migrations/CHANGELOG.md b/packages/migrations/CHANGELOG.md index 420769187..937ca0dce 100644 --- a/packages/migrations/CHANGELOG.md +++ b/packages/migrations/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.3.1 - _January 11, 2019_ + + * Dependencies updated + ## v2.3.0 - _January 9, 2019_ * Added migrations for Dutch Auction contract (#1465) -- cgit v1.2.3 From cf3787edbb9e8acf7160ab93b903b54c63bdffda Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 11 Jan 2019 18:04:43 +0100 Subject: Publish - 0x.js@3.0.1 - @0x/abi-gen@1.0.21 - @0x/abi-gen-wrappers@2.1.1 - @0x/assert@1.0.22 - @0x/asset-buyer@4.0.0 - @0x/base-contract@3.0.12 - @0x/connect@3.0.12 - @0x/contract-wrappers@4.2.1 - @0x/dev-tools-pages@0.0.12 - @0x/dev-utils@1.0.23 - ethereum-types@1.1.5 - @0x/fill-scenarios@1.1.1 - @0x/instant@1.0.6 - @0x/json-schemas@2.1.6 - @0x/metacoin@0.0.34 - @0x/migrations@2.3.1 - @0x/monorepo-scripts@1.0.17 - @0x/order-utils@3.1.1 - @0x/order-watcher@2.4.1 - @0x/pipeline@1.0.4 - @0x/react-docs@1.0.24 - @0x/react-shared@1.1.1 - @0x/sol-compiler@2.0.1 - @0x/sol-coverage@1.0.1 - @0x/sol-doc@1.0.13 - @0x/sol-profiler@1.0.1 - @0x/sol-resolver@1.2.2 - @0x/sol-trace@1.0.1 - @0x/sol-tracing-utils@3.0.0 - @0x/sra-spec@1.0.15 - @0x/subproviders@2.1.10 - @0x/testnet-faucets@1.0.62 - @0x/tslint-config@2.0.1 - @0x/types@1.5.1 - @0x/typescript-typings@3.0.7 - @0x/utils@3.0.0 - @0x/web3-wrapper@3.2.3 - @0x/website@0.0.65 - @0x/contracts-examples@1.0.4 - @0x/contracts-extensions@1.2.1 - @0x/contracts-interfaces@1.0.4 - @0x/contracts-libs@1.0.4 - @0x/contracts-multisig@1.0.4 - @0x/contracts-protocol@2.2.1 - @0x/contracts-test-utils@1.0.4 - @0x/contracts-tokens@1.0.4 - @0x/contracts-utils@1.0.4 --- packages/migrations/package.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'packages/migrations') diff --git a/packages/migrations/package.json b/packages/migrations/package.json index 774236ab4..d52f09b59 100644 --- a/packages/migrations/package.json +++ b/packages/migrations/package.json @@ -1,6 +1,6 @@ { "name": "@0x/migrations", - "version": "2.3.0", + "version": "2.3.1", "engines": { "node": ">=6.12" }, @@ -35,9 +35,9 @@ }, "license": "Apache-2.0", "devDependencies": { - "@0x/dev-utils": "^1.0.22", - "@0x/tslint-config": "^2.0.0", - "@0x/types": "^1.5.0", + "@0x/dev-utils": "^1.0.23", + "@0x/tslint-config": "^2.0.1", + "@0x/types": "^1.5.1", "@types/yargs": "^10.0.0", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", @@ -48,18 +48,18 @@ "yargs": "^10.0.3" }, "dependencies": { - "@0x/abi-gen-wrappers": "^2.1.0", - "@0x/base-contract": "^3.0.11", + "@0x/abi-gen-wrappers": "^2.1.1", + "@0x/base-contract": "^3.0.12", "@0x/contract-addresses": "^2.1.0", "@0x/contract-artifacts": "^1.2.0", - "@0x/order-utils": "^3.1.0", - "@0x/sol-compiler": "^2.0.0", - "@0x/subproviders": "^2.1.9", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", + "@0x/order-utils": "^3.1.1", + "@0x/sol-compiler": "^2.0.1", + "@0x/subproviders": "^2.1.10", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", "@ledgerhq/hw-app-eth": "^4.3.0", - "ethereum-types": "^1.1.4", + "ethereum-types": "^1.1.5", "ethers": "~4.0.4", "lodash": "^4.17.5" }, -- cgit v1.2.3 From e3b3f82c8c48219de70c7bb3f8a0816c98f41ed0 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Thu, 10 Jan 2019 23:12:45 +1100 Subject: feature(migrations): Add MultiAssetProxy Migration --- packages/migrations/CHANGELOG.json | 15 ++++++- packages/migrations/src/migration.ts | 84 ++++++++++++++++++++++++------------ 2 files changed, 70 insertions(+), 29 deletions(-) (limited to 'packages/migrations') diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 13aca373b..13a99bb05 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.4.0", + "changes": [ + { + "note": "Added migrations for `MultiAssetProxy` contract", + "pr": 1503 + } + ] + }, { "timestamp": 1547225310, "version": "2.3.1", @@ -58,7 +67,8 @@ "version": "2.1.0", "changes": [ { - "note": "Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping", + "note": + "Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping", "pr": 1301 } ], @@ -104,7 +114,8 @@ "version": "2.0.0", "changes": [ { - "note": "Contract artifacts have been moved to the new @0xproject/contract-artifacts package. v1 migrations have been removed. `runMigrationsAsync` returns the addresses of the contracts that were deployed.", + "note": + "Contract artifacts have been moved to the new @0xproject/contract-artifacts package. v1 migrations have been removed. `runMigrationsAsync` returns the addresses of the contracts that were deployed.", "pr": 1105 } ], diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts index 99d1719f1..3d97409e6 100644 --- a/packages/migrations/src/migration.ts +++ b/packages/migrations/src/migration.ts @@ -68,13 +68,46 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial secondsRequired, ); + // Dummy ERC20 tokens + for (const token of erc20TokenInfo) { + const totalSupply = new BigNumber(1000000000000000000000000000); + // tslint:disable-next-line:no-unused-variable + const dummyErc20Token = await wrappers.DummyERC20TokenContract.deployFrom0xArtifactAsync( + artifacts.DummyERC20Token, + provider, + txDefaults, + token.name, + token.symbol, + token.decimals, + totalSupply, + ); + } + + // ERC721 + // tslint:disable-next-line:no-unused-variable + const cryptoKittieToken = await wrappers.DummyERC721TokenContract.deployFrom0xArtifactAsync( + artifacts.DummyERC721Token, + provider, + txDefaults, + erc721TokenInfo[0].name, + erc721TokenInfo[0].symbol, + ); + + const multiAssetProxy = await wrappers.MultiAssetProxyContract.deployFrom0xArtifactAsync( + artifacts.MultiAssetProxy, + provider, + txDefaults, + ); + + // Note: Perform all setup after contract deployments to have consistent addresses + // available in the snapshots await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner, }), ); await web3Wrapper.awaitTransactionSuccessAsync( - await erc20Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, { + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { from: owner, }), ); @@ -84,7 +117,7 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial }), ); await web3Wrapper.awaitTransactionSuccessAsync( - await erc721Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, { + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { from: owner, }), ); @@ -96,30 +129,8 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial await web3Wrapper.awaitTransactionSuccessAsync( await exchange.registerAssetProxy.sendTransactionAsync(erc721Proxy.address), ); - - // Dummy ERC20 tokens - for (const token of erc20TokenInfo) { - const totalSupply = new BigNumber(1000000000000000000000000000); - // tslint:disable-next-line:no-unused-variable - const dummyErc20Token = await wrappers.DummyERC20TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyERC20Token, - provider, - txDefaults, - token.name, - token.symbol, - token.decimals, - totalSupply, - ); - } - - // ERC721 - // tslint:disable-next-line:no-unused-variable - const cryptoKittieToken = await wrappers.DummyERC721TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyERC721Token, - provider, - txDefaults, - erc721TokenInfo[0].name, - erc721TokenInfo[0].symbol, + await web3Wrapper.awaitTransactionSuccessAsync( + await exchange.registerAssetProxy.sendTransactionAsync(multiAssetProxy.address), ); // Forwarder @@ -149,6 +160,23 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial exchange.address, ); + // Transfer Ownership to the Asset Proxy Owner + await web3Wrapper.awaitTransactionSuccessAsync( + await erc20Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, { + from: owner, + }), + ); + await web3Wrapper.awaitTransactionSuccessAsync( + await erc721Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, { + from: owner, + }), + ); + await web3Wrapper.awaitTransactionSuccessAsync( + await multiAssetProxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, { + from: owner, + }), + ); + // Fund the Forwarder with ZRX const zrxDecimals = await zrxToken.decimals.callAsync(); const zrxForwarderAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5000), zrxDecimals); @@ -156,7 +184,7 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial await zrxToken.transfer.sendTransactionAsync(forwarder.address, zrxForwarderAmount, txDefaults), ); - return { + const contractAddresses = { erc20Proxy: erc20Proxy.address, erc721Proxy: erc721Proxy.address, zrxToken: zrxToken.address, @@ -167,6 +195,8 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial orderValidator: orderValidator.address, dutchAuction: dutchAuction.address, }; + + return contractAddresses; } let _cachedContractAddresses: ContractAddresses; -- cgit v1.2.3 From 34cce04c434cf34c7fc742aa1a3ccdb8c6f06a56 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Fri, 11 Jan 2019 09:29:53 +1100 Subject: Register ERC20/721 into MAP --- packages/migrations/src/migration.ts | 44 +++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 18 deletions(-) (limited to 'packages/migrations') diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts index 3d97409e6..8e6ae7726 100644 --- a/packages/migrations/src/migration.ts +++ b/packages/migrations/src/migration.ts @@ -18,6 +18,8 @@ import { erc20TokenInfo, erc721TokenInfo } from './utils/token_info'; */ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial): Promise { const web3Wrapper = new Web3Wrapper(provider); + const accounts: string[] = await web3Wrapper.getAvailableAddressesAsync(); + const owner = accounts[0]; // Proxies const erc20Proxy = await wrappers.ERC20ProxyContract.deployFrom0xArtifactAsync( @@ -50,24 +52,6 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial zrxAssetData, ); - // Multisigs - const accounts: string[] = await web3Wrapper.getAvailableAddressesAsync(); - const owners = [accounts[0], accounts[1]]; - const confirmationsRequired = new BigNumber(2); - const secondsRequired = new BigNumber(0); - const owner = accounts[0]; - - // AssetProxyOwner - const assetProxyOwner = await wrappers.AssetProxyOwnerContract.deployFrom0xArtifactAsync( - artifacts.AssetProxyOwner, - provider, - txDefaults, - owners, - [erc20Proxy.address, erc721Proxy.address], - confirmationsRequired, - secondsRequired, - ); - // Dummy ERC20 tokens for (const token of erc20TokenInfo) { const totalSupply = new BigNumber(1000000000000000000000000000); @@ -122,6 +106,14 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial }), ); + // Register Asset Proxies to the MultiAssetProxy + await web3Wrapper.awaitTransactionSuccessAsync( + await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address), + ); + await web3Wrapper.awaitTransactionSuccessAsync( + await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address), + ); + // Register the Asset Proxies to the Exchange await web3Wrapper.awaitTransactionSuccessAsync( await exchange.registerAssetProxy.sendTransactionAsync(erc20Proxy.address), @@ -160,6 +152,22 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial exchange.address, ); + // Multisigs + const owners = [accounts[0], accounts[1]]; + const confirmationsRequired = new BigNumber(2); + const secondsRequired = new BigNumber(0); + + // AssetProxyOwner + const assetProxyOwner = await wrappers.AssetProxyOwnerContract.deployFrom0xArtifactAsync( + artifacts.AssetProxyOwner, + provider, + txDefaults, + owners, + [erc20Proxy.address, erc721Proxy.address, multiAssetProxy.address], + confirmationsRequired, + secondsRequired, + ); + // Transfer Ownership to the Asset Proxy Owner await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, { -- cgit v1.2.3 From 043fb3f46021f3f46f87d96db3ab02b92c8ab254 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Sat, 12 Jan 2019 16:50:16 +1100 Subject: Group similar setup transactions --- packages/migrations/src/migration.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'packages/migrations') diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts index 8e6ae7726..e0f245017 100644 --- a/packages/migrations/src/migration.ts +++ b/packages/migrations/src/migration.ts @@ -83,20 +83,25 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial txDefaults, ); - // Note: Perform all setup after contract deployments to have consistent addresses - // available in the snapshots await web3Wrapper.awaitTransactionSuccessAsync( await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner, }), ); await web3Wrapper.awaitTransactionSuccessAsync( - await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { + await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner, }), ); await web3Wrapper.awaitTransactionSuccessAsync( - await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + await multiAssetProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { + from: owner, + }), + ); + + // MultiAssetProxy + await web3Wrapper.awaitTransactionSuccessAsync( + await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { from: owner, }), ); @@ -105,8 +110,6 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial from: owner, }), ); - - // Register Asset Proxies to the MultiAssetProxy await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address), ); -- cgit v1.2.3 From b108b1119a890ebefb29226ac404d8dfd09fd859 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Mon, 14 Jan 2019 10:10:39 +1100 Subject: Update prettier changelogs --- packages/migrations/CHANGELOG.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'packages/migrations') diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 13a99bb05..6a7df758b 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -67,8 +67,7 @@ "version": "2.1.0", "changes": [ { - "note": - "Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping", + "note": "Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping", "pr": 1301 } ], @@ -114,8 +113,7 @@ "version": "2.0.0", "changes": [ { - "note": - "Contract artifacts have been moved to the new @0xproject/contract-artifacts package. v1 migrations have been removed. `runMigrationsAsync` returns the addresses of the contracts that were deployed.", + "note": "Contract artifacts have been moved to the new @0xproject/contract-artifacts package. v1 migrations have been removed. `runMigrationsAsync` returns the addresses of the contracts that were deployed.", "pr": 1105 } ], -- cgit v1.2.3