Remove MixinZrxVault
This commit is contained in:
		@@ -39,7 +39,7 @@ contract MixinStake is
 | 
			
		||||
        address payable owner = msg.sender;
 | 
			
		||||
 | 
			
		||||
        // deposit equivalent amount of ZRX into vault
 | 
			
		||||
        _depositFromOwnerIntoZrxVault(owner, amount);
 | 
			
		||||
        zrxVault.depositFrom(owner, amount);
 | 
			
		||||
 | 
			
		||||
        // mint stake
 | 
			
		||||
        _incrementCurrentAndNextBalance(_activeStakeByOwner[owner], amount);
 | 
			
		||||
@@ -77,7 +77,7 @@ contract MixinStake is
 | 
			
		||||
        _withdrawableStakeByOwner[owner] = currentWithdrawableStake.safeSub(amount);
 | 
			
		||||
 | 
			
		||||
        // withdraw equivalent amount of ZRX from vault
 | 
			
		||||
        _withdrawToOwnerFromZrxVault(owner, amount);
 | 
			
		||||
        zrxVault.withdrawFrom(owner, amount);
 | 
			
		||||
 | 
			
		||||
        // emit stake event
 | 
			
		||||
        emit Unstake(
 | 
			
		||||
 
 | 
			
		||||
@@ -21,14 +21,12 @@ pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "@0x/contracts-utils/contracts/src/LibSafeMath.sol";
 | 
			
		||||
import "../interfaces/IStructs.sol";
 | 
			
		||||
import "./MixinZrxVault.sol";
 | 
			
		||||
import "./MixinStakeStorage.sol";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/// @dev This mixin contains logic for querying stake balances.
 | 
			
		||||
/// **** Read MixinStake before continuing ****
 | 
			
		||||
contract MixinStakeBalances is
 | 
			
		||||
    MixinZrxVault,
 | 
			
		||||
    MixinStakeStorage
 | 
			
		||||
{
 | 
			
		||||
    using LibSafeMath for uint256;
 | 
			
		||||
@@ -41,7 +39,7 @@ contract MixinStakeBalances is
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256)
 | 
			
		||||
    {
 | 
			
		||||
        return _balanceOfOwnerInZrxVault(owner);
 | 
			
		||||
        return zrxVault.balanceOf(owner);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// @dev Returns the active stake for a given owner.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,57 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
  Copyright 2019 ZeroEx Intl.
 | 
			
		||||
 | 
			
		||||
  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
  you may not use this file except in compliance with the License.
 | 
			
		||||
  You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
  See the License for the specific language governing permissions and
 | 
			
		||||
  limitations under the License.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
pragma solidity ^0.5.9;
 | 
			
		||||
 | 
			
		||||
import "../interfaces/IZrxVault.sol";
 | 
			
		||||
import "../immutable/MixinStorage.sol";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/// @dev This mixin contains logic for managing and interfacing with the Zrx Vault.
 | 
			
		||||
/// (see vaults/ZrxVault.sol).
 | 
			
		||||
contract MixinZrxVault is
 | 
			
		||||
    MixinStorage
 | 
			
		||||
{
 | 
			
		||||
    /// @dev Deposits Zrx Tokens from the `owner` into the vault.
 | 
			
		||||
    /// @param owner of Zrx Tokens
 | 
			
		||||
    /// @param amount of tokens to deposit.
 | 
			
		||||
    function _depositFromOwnerIntoZrxVault(address owner, uint256 amount)
 | 
			
		||||
        internal
 | 
			
		||||
    {
 | 
			
		||||
        zrxVault.depositFrom(owner, amount);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// @dev Withdraws Zrx Tokens from to `owner` from the vault.
 | 
			
		||||
    /// @param owner of deposited Zrx Tokens
 | 
			
		||||
    /// @param amount of tokens to withdraw.
 | 
			
		||||
    function _withdrawToOwnerFromZrxVault(address owner, uint256 amount)
 | 
			
		||||
        internal
 | 
			
		||||
    {
 | 
			
		||||
        zrxVault.withdrawFrom(owner, amount);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// @dev Returns balance of `owner` in the ZRX ault.
 | 
			
		||||
    /// @param owner of deposited Zrx Tokens.
 | 
			
		||||
    function _balanceOfOwnerInZrxVault(address owner)
 | 
			
		||||
        internal
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256)
 | 
			
		||||
    {
 | 
			
		||||
        return zrxVault.balanceOf(owner);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -37,7 +37,7 @@
 | 
			
		||||
    },
 | 
			
		||||
    "config": {
 | 
			
		||||
        "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
 | 
			
		||||
        "abis": "./generated-artifacts/@(EthVault|IEthVault|IStaking|IStakingEvents|IStakingPoolRewardVault|IStakingProxy|IStorage|IStorageInit|IStructs|IVaultCore|IZrxVault|LibFixedMath|LibFixedMathRichErrors|LibProxy|LibSafeDowncast|LibStakingRichErrors|MixinConstants|MixinCumulativeRewards|MixinDeploymentConstants|MixinExchangeFees|MixinExchangeManager|MixinParams|MixinScheduler|MixinStake|MixinStakeBalances|MixinStakeStorage|MixinStakingPool|MixinStakingPoolRewardVault|MixinStakingPoolRewards|MixinStorage|MixinVaultCore|MixinZrxVault|ReadOnlyProxy|Staking|StakingPoolRewardVault|StakingProxy|TestCobbDouglas|TestCumulativeRewardTracking|TestInitTarget|TestLibFixedMath|TestLibProxy|TestLibProxyReceiver|TestLibSafeDowncast|TestProtocolFees|TestProtocolFeesERC20Proxy|TestStaking|TestStakingProxy|TestStorageLayout|ZrxVault).json"
 | 
			
		||||
        "abis": "./generated-artifacts/@(EthVault|IEthVault|IStaking|IStakingEvents|IStakingPoolRewardVault|IStakingProxy|IStorage|IStorageInit|IStructs|IVaultCore|IZrxVault|LibFixedMath|LibFixedMathRichErrors|LibProxy|LibSafeDowncast|LibStakingRichErrors|MixinConstants|MixinCumulativeRewards|MixinDeploymentConstants|MixinExchangeFees|MixinExchangeManager|MixinParams|MixinScheduler|MixinStake|MixinStakeBalances|MixinStakeStorage|MixinStakingPool|MixinStakingPoolRewardVault|MixinStakingPoolRewards|MixinStorage|MixinVaultCore|ReadOnlyProxy|Staking|StakingPoolRewardVault|StakingProxy|TestCobbDouglas|TestCumulativeRewardTracking|TestInitTarget|TestLibFixedMath|TestLibProxy|TestLibProxyReceiver|TestLibSafeDowncast|TestProtocolFees|TestProtocolFeesERC20Proxy|TestStaking|TestStakingProxy|TestStorageLayout|ZrxVault).json"
 | 
			
		||||
    },
 | 
			
		||||
    "repository": {
 | 
			
		||||
        "type": "git",
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,6 @@ import * as MixinStakingPoolRewards from '../generated-artifacts/MixinStakingPoo
 | 
			
		||||
import * as MixinStakingPoolRewardVault from '../generated-artifacts/MixinStakingPoolRewardVault.json';
 | 
			
		||||
import * as MixinStorage from '../generated-artifacts/MixinStorage.json';
 | 
			
		||||
import * as MixinVaultCore from '../generated-artifacts/MixinVaultCore.json';
 | 
			
		||||
import * as MixinZrxVault from '../generated-artifacts/MixinZrxVault.json';
 | 
			
		||||
import * as ReadOnlyProxy from '../generated-artifacts/ReadOnlyProxy.json';
 | 
			
		||||
import * as Staking from '../generated-artifacts/Staking.json';
 | 
			
		||||
import * as StakingPoolRewardVault from '../generated-artifacts/StakingPoolRewardVault.json';
 | 
			
		||||
@@ -81,7 +80,6 @@ export const artifacts = {
 | 
			
		||||
    MixinStake: MixinStake as ContractArtifact,
 | 
			
		||||
    MixinStakeBalances: MixinStakeBalances as ContractArtifact,
 | 
			
		||||
    MixinStakeStorage: MixinStakeStorage as ContractArtifact,
 | 
			
		||||
    MixinZrxVault: MixinZrxVault as ContractArtifact,
 | 
			
		||||
    MixinCumulativeRewards: MixinCumulativeRewards as ContractArtifact,
 | 
			
		||||
    MixinStakingPool: MixinStakingPool as ContractArtifact,
 | 
			
		||||
    MixinStakingPoolRewardVault: MixinStakingPoolRewardVault as ContractArtifact,
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,6 @@ export * from '../generated-wrappers/mixin_staking_pool_reward_vault';
 | 
			
		||||
export * from '../generated-wrappers/mixin_staking_pool_rewards';
 | 
			
		||||
export * from '../generated-wrappers/mixin_storage';
 | 
			
		||||
export * from '../generated-wrappers/mixin_vault_core';
 | 
			
		||||
export * from '../generated-wrappers/mixin_zrx_vault';
 | 
			
		||||
export * from '../generated-wrappers/read_only_proxy';
 | 
			
		||||
export * from '../generated-wrappers/staking';
 | 
			
		||||
export * from '../generated-wrappers/staking_pool_reward_vault';
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,6 @@
 | 
			
		||||
        "generated-artifacts/MixinStakingPoolRewards.json",
 | 
			
		||||
        "generated-artifacts/MixinStorage.json",
 | 
			
		||||
        "generated-artifacts/MixinVaultCore.json",
 | 
			
		||||
        "generated-artifacts/MixinZrxVault.json",
 | 
			
		||||
        "generated-artifacts/ReadOnlyProxy.json",
 | 
			
		||||
        "generated-artifacts/Staking.json",
 | 
			
		||||
        "generated-artifacts/StakingPoolRewardVault.json",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user