Remove TestStaking

CHANGELOG updates
Rebase and clean imports
Fix lint
This commit is contained in:
Jacob Evans 2019-11-07 23:25:33 +11:00
parent 21fab3ef9f
commit 724085e068
No known key found for this signature in database
GPG Key ID: 2036DA2ADDFB0842
14 changed files with 113 additions and 11949 deletions

View File

@ -21,7 +21,7 @@
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output src/generated-wrappers --backend ethers"
},
"config": {
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DevUtils|DutchAuction|DummyERC20Token|DummyERC721Token|ERC1155Mintable|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IAssetProxy|IValidator|IWallet|MultiAssetProxy|OrderValidator|WETH9|ZRXToken|Coordinator|CoordinatorRegistry|EthBalanceChecker|ERC1155Proxy|StaticCallProxy|Staking|StakingProxy|TestStaking|ZrxVault|ERC20BridgeProxy).json"
"abis": "../contract-artifacts/artifacts/@(DevUtils|DummyERC20Token|DummyERC721Token|ERC1155Mintable|ERC20Token|ERC721Token|Exchange|Forwarder|IValidator|IWallet|OrderValidator|WETH9|Coordinator|CoordinatorRegistry|Staking|StakingProxy).json"
},
"repository": {
"type": "git",

File diff suppressed because one or more lines are too long

View File

@ -262,11 +262,11 @@ export class StakingContract extends BaseContract {
{
inputs: [
{
name: 'wethAddress',
name: 'wethAddress_',
type: 'address',
},
{
name: 'zrxVaultAddress',
name: 'zrxVaultAddress_',
type: 'address',
},
],
@ -1195,7 +1195,7 @@ export class StakingContract extends BaseContract {
name: 'getWethContract',
outputs: [
{
name: '',
name: 'wethContract',
type: 'address',
},
],
@ -1533,34 +1533,6 @@ export class StakingContract extends BaseContract {
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [],
name: 'testWethAddress',
outputs: [
{
name: '',
type: 'address',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [],
name: 'testZrxVaultAddress',
outputs: [
{
name: '',
type: 'address',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: false,
inputs: [

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -100,30 +100,6 @@ export {
CoordinatorRegistryCoordinatorEndpointSetEventArgs,
CoordinatorRegistryContract,
} from './generated-wrappers/coordinator_registry';
export {
ZrxVaultAuthorizedAddressAddedEventArgs,
ZrxVaultAuthorizedAddressRemovedEventArgs,
ZrxVaultContract,
ZrxVaultDepositEventArgs,
ZrxVaultEventArgs,
ZrxVaultEvents,
ZrxVaultInCatastrophicFailureModeEventArgs,
ZrxVaultOwnershipTransferredEventArgs,
ZrxVaultStakingProxySetEventArgs,
ZrxVaultWithdrawEventArgs,
ZrxVaultZrxProxySetEventArgs,
} from './generated-wrappers/zrx_vault';
export {
ERC20BridgeProxyAuthorizedAddressAddedEventArgs,
ERC20BridgeProxyAuthorizedAddressRemovedEventArgs,
ERC20BridgeProxyContract,
ERC20BridgeProxyEventArgs,
ERC20BridgeProxyEvents,
} from './generated-wrappers/erc20_bridge_proxy';
// Note: No need to export other events as this is a StakingContract with more open constructor args
export { TestStakingContract } from './generated-wrappers/test_staking';
export * from '@0x/contract-addresses';
export {

View File

@ -39,7 +39,7 @@
"multiAssetProxy": "0xab8fbd189c569ccdee3a4d929bb7f557be4028f6",
"staticCallProxy": "0xe1b97e47aa3796276033a5341e884d2ba46b6ac1",
"erc1155Proxy": "0x19bb6caa3bc34d39e5a23cedfa3e6c7e7f3c931d",
"devUtils": "0x1f7a9c2e2c25ab1a894af1fd816599860ee2276c",
"devUtils": "0x6bb2fc91a82b55c02b88873958a19e04fbd02090",
"zrxVault": "0xffd161026865ad8b4ab28a76840474935eec4dfa",
"staking": "0x3f46b98061a3e1e1f41dff296ec19402c298f8a9",
"stakingProxy": "0xfaabcee42ab6b9c649794ac6c133711071897ee9",
@ -62,7 +62,7 @@
"multiAssetProxy": "0xb34cde0ad3a83d04abebc0b66e75196f22216621",
"staticCallProxy": "0xe1b97e47aa3796276033a5341e884d2ba46b6ac1",
"erc1155Proxy": "0x19bb6caa3bc34d39e5a23cedfa3e6c7e7f3c931d",
"devUtils": "0xfd21088fb008349839c2209ecbde97a7a4d2e397",
"devUtils": "0x326a303dc0fe20f43acb8e5dec99154e47f32d01",
"zrxVault": "0xa5bf6ac73bc40790fc6ffc9dbbbce76c9176e224",
"staking": "0x344d4f661a82afdd84d31456c291822d90d5dc3a",
"stakingProxy": "0xc6ad5277ea225ac05e271eb14a7ebb480cd9dd9f",
@ -85,7 +85,7 @@
"multiAssetProxy": "0xf6313a772c222f51c28f2304c0703b8cf5428fd8",
"staticCallProxy": "0x48e94bdb9033640d45ea7c721e25f380f8bffa43",
"erc1155Proxy": "0x64517fa2b480ba3678a2a3c0cf08ef7fd4fad36f",
"devUtils": "0xa3858baf73430c2fa2339c731e3ffb04ea5e359c",
"devUtils": "0x5078321eec0fd8db5d61d25cce3ea2d6379bb5df",
"zrxVault": "0xf36eabdfe986b35b62c8fd5a98a7f2aebb79b291",
"staking": "0x89150f5eed50b3528f79bfb539f29d727f92821c",
"stakingProxy": "0xbab9145f1d57cd4bb0c9aa2d1ece0a5b6e734d34",

View File

@ -5,6 +5,10 @@
{
"note": "Replace Staking artifact with TestStaking",
"pr": 2322
},
{
"note": "Added `ZrxVault` and `ERC20BridgeProxy` artifacts",
"pr": 2323
}
]
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,42 +1,30 @@
import * as AssetProxyOwner from '../artifacts/AssetProxyOwner.json';
import * as Coordinator from '../artifacts/Coordinator.json';
import * as CoordinatorRegistry from '../artifacts/CoordinatorRegistry.json';
import * as DevUtils from '../artifacts/DevUtils.json';
import * as Exchange from '../artifacts/Exchange.json';
import * as Forwarder from '../artifacts/Forwarder.json';
import * as Staking from '../artifacts/Staking.json';
import * as WETH9 from '../artifacts/WETH9.json';
// Order Utils
import * as IValidator from '../artifacts/IValidator.json';
import * as IWallet from '../artifacts/IWallet.json';
// Tokens (allowances, transfers, events)
import * as ERC20Token from '../artifacts/ERC20Token.json';
import * as ERC721Token from '../artifacts/ERC721Token.json';
// Migrations Testnet/Ganache
import * as AssetProxyOwner from '../artifacts/AssetProxyOwner.json';
import * as DummyERC20Token from '../artifacts/DummyERC20Token.json';
import * as DummyERC721Token from '../artifacts/DummyERC721Token.json';
import * as ERC1155Mintable from '../artifacts/ERC1155Mintable.json';
import * as StakingProxy from '../artifacts/StakingProxy.json';
import * as TestStaking from '../artifacts/TestStaking.json';
import * as ZrxVault from '../artifacts/ZrxVault.json';
// Proxies (Migrations)
import * as ERC1155Proxy from '../artifacts/ERC1155Proxy.json';
import * as ERC20BridgeProxy from '../artifacts/ERC20BridgeProxy.json';
import * as ERC20Proxy from '../artifacts/ERC20Proxy.json';
import * as ERC721Proxy from '../artifacts/ERC721Proxy.json';
import * as MultiAssetProxy from '../artifacts/MultiAssetProxy.json';
import * as StaticCallProxy from '../artifacts/StaticCallProxy.json';
// Unknown/Unused
import * as DutchAuction from '../artifacts/DutchAuction.json';
import * as ERC1155Mintable from '../artifacts/ERC1155Mintable.json';
import * as ERC1155Proxy from '../artifacts/ERC1155Proxy.json';
import * as ERC20Proxy from '../artifacts/ERC20Proxy.json';
import * as ERC20Token from '../artifacts/ERC20Token.json';
import * as ERC721Proxy from '../artifacts/ERC721Proxy.json';
import * as ERC721Token from '../artifacts/ERC721Token.json';
import * as Exchange from '../artifacts/Exchange.json';
import * as Forwarder from '../artifacts/Forwarder.json';
import * as IAssetProxy from '../artifacts/IAssetProxy.json';
import * as IValidator from '../artifacts/IValidator.json';
import * as IWallet from '../artifacts/IWallet.json';
import * as MultiAssetProxy from '../artifacts/MultiAssetProxy.json';
import * as OrderValidator from '../artifacts/OrderValidator.json';
import * as Staking from '../artifacts/Staking.json';
import * as StakingProxy from '../artifacts/StakingProxy.json';
import * as StaticCallProxy from '../artifacts/StaticCallProxy.json';
import * as WETH9 from '../artifacts/WETH9.json';
import * as ZRXToken from '../artifacts/ZRXToken.json';
import * as ERC20BridgeProxy from '../artifacts/ERC20BridgeProxy.json';
import * as ZrxVault from '../artifacts/ZrxVault.json';
export {
AssetProxyOwner,
@ -65,6 +53,5 @@ export {
CoordinatorRegistry,
Staking,
StakingProxy,
TestStaking,
ZrxVault,
};

View File

@ -32,7 +32,6 @@
"./artifacts/StaticCallProxy.json",
"./artifacts/Staking.json",
"./artifacts/StakingProxy.json",
"./artifacts/TestStaking.json",
"./artifacts/ZrxVault.json",
"./artifacts/ERC20BridgeProxy.json"
]

View File

@ -5,6 +5,10 @@
{
"note": "Migrations script no longer deploys DutchAuction since it is not yet upgraded for V3 of the protocol",
"pr": 2324
},
{
"note": "Added `Staking` and `ERC20BridgeProxy` contracts",
"pr": 2323
}
]
},

View File

@ -1,21 +1,22 @@
import { CoordinatorContract, OrderValidatorContract, ZrxVaultContract } from '@0x/abi-gen-wrappers';
import { CoordinatorContract } from '@0x/abi-gen-wrappers';
import { ContractAddresses } from '@0x/contract-addresses';
import * as artifacts from '@0x/contract-artifacts';
import {
ERC1155ProxyContract,
ERC20BridgeProxyContract,
ERC20ProxyContract,
ERC721ProxyContract,
MultiAssetProxyContract,
StaticCallProxyContract,
ERC20BridgeProxyContract,
} from '@0x/contracts-asset-proxy';
import { CoordinatorRegistryContract } from '@0x/contracts-coordinator';
import { DevUtilsContract } from '@0x/contracts-dev-utils';
import { ERC1155MintableContract } from '@0x/contracts-erc1155';
import { DummyERC20TokenContract, WETH9Contract, ZRXTokenContract } from '@0x/contracts-erc20';
import { DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20';
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
import { ExchangeContract } from '@0x/contracts-exchange';
import { ForwarderContract } from '@0x/contracts-exchange-forwarder';
import { StakingProxyContract, TestStakingContract, ZrxVaultContract } from '@0x/contracts-staking';
import { Web3ProviderEngine } from '@0x/subproviders';
import { AbiEncoder, BigNumber, providerUtils } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
@ -23,7 +24,6 @@ import { MethodAbi, SupportedProvider, TxData } from 'ethereum-types';
import { constants } from './utils/constants';
import { erc20TokenInfo, erc721TokenInfo } from './utils/token_info';
import { TestStakingContract, StakingProxyContract } from '@0x/contracts-staking';
// HACK (xianny): Copied from @0x/order-utils to get rid of circular dependency
/**
@ -99,8 +99,6 @@ export async function runMigrationsAsync(
const etherToken = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults, artifacts);
// Exchange
// tslint:disable-next-line:no-unused-variable
const zrxAssetData = encodeERC20AssetData(zrxToken.address);
const exchange = await ExchangeContract.deployFrom0xArtifactAsync(
artifacts.Exchange,
provider,
@ -189,42 +187,6 @@ export async function runMigrationsAsync(
encodeERC20AssetData(etherToken.address),
);
// TODO (xianny): figure out how to deploy AssetProxyOwnerContract properly
// // Multisigs
// const accounts: string[] = await web3Wrapper.getAvailableAddressesAsync();
// const owners = _.uniq([accounts[0], accounts[1], txDefaults.from]);
// const confirmationsRequired = new BigNumber(2);
// const secondsRequired = new BigNumber(0);
// // AssetProxyOwner
// const assetProxyOwner = await AssetProxyOwnerContract.deployFrom0xArtifactAsync(
// artifacts.AssetProxyOwner,
// provider,
// txDefaults,
// artifacts,
// [],
// [erc20Proxy.address, erc721Proxy.address, multiAssetProxy.address],
// [],
// owners,
// confirmationsRequired,
// secondsRequired,
// );
// // Transfer Ownership to the Asset Proxy Owner
// await web3Wrapper.awaitTransactionSuccessAsync(
// await erc20Proxy.transferOwnership(assetProxyOwner.address).sendTransactionAsync(txDefaults),
// );
// await web3Wrapper.awaitTransactionSuccessAsync(
// await erc721Proxy.transferOwnership(assetProxyOwner.address).sendTransactionAsync(txDefaults),
// );
// await web3Wrapper.awaitTransactionSuccessAsync(
// await erc1155Proxy.transferOwnership(assetProxyOwner.address).sendTransactionAsync(txDefaults),
// );
// await web3Wrapper.awaitTransactionSuccessAsync(
// await multiAssetProxy.transferOwnership(assetProxyOwner.address).sendTransactionAsync(txDefaults),
// );
// Fake the above transactions so our nonce increases and we result with the same addresses
// while AssetProxyOwner is disabled (TODO: @dekz remove)
const dummyTransactionCount = 8;
@ -326,7 +288,6 @@ export async function runMigrationsAsync(
zrxToken: zrxToken.address,
etherToken: etherToken.address,
exchange: exchange.address,
// TODO (xianny): figure out how to deploy AssetProxyOwnerContract
assetProxyOwner: constants.NULL_ADDRESS,
erc20BridgeProxy: erc20BridgeProxy.address,
zeroExGovernor: constants.NULL_ADDRESS,