From 57ca601be1eb64de710e28cf29c8eb765abe94bd Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Sun, 29 Sep 2019 15:45:08 -0700 Subject: [PATCH] Remove wethAssetProxy and wethAssetData from staking contract --- .../contracts/src/fees/MixinExchangeFees.sol | 12 ++++--- .../immutable/MixinDeploymentConstants.sol | 35 ------------------- 2 files changed, 7 insertions(+), 40 deletions(-) diff --git a/contracts/staking/contracts/src/fees/MixinExchangeFees.sol b/contracts/staking/contracts/src/fees/MixinExchangeFees.sol index 0ab5634346..37dc7159f6 100644 --- a/contracts/staking/contracts/src/fees/MixinExchangeFees.sol +++ b/contracts/staking/contracts/src/fees/MixinExchangeFees.sol @@ -56,11 +56,13 @@ contract MixinExchangeFees is // Transfer the protocol fee to this address if it should be paid in // WETH. if (msg.value == 0) { - getWethAssetProxy().transferFrom( - getWethAssetData(), - payerAddress, - address(this), - protocolFeePaid + require( + getWethContract().transferFrom( + payerAddress, + address(this), + protocolFeePaid + ), + "WETH_TRANSFER_FAILED" ); } diff --git a/contracts/staking/contracts/src/immutable/MixinDeploymentConstants.sol b/contracts/staking/contracts/src/immutable/MixinDeploymentConstants.sol index 0d763f69d9..6aa23444b3 100644 --- a/contracts/staking/contracts/src/immutable/MixinDeploymentConstants.sol +++ b/contracts/staking/contracts/src/immutable/MixinDeploymentConstants.sol @@ -18,7 +18,6 @@ pragma solidity ^0.5.9; -import "@0x/contracts-asset-proxy/contracts/src/interfaces/IAssetProxy.sol"; import "@0x/contracts-erc20/contracts/src/interfaces/IEtherToken.sol"; import "../interfaces/IZrxVault.sol"; @@ -37,17 +36,7 @@ contract MixinDeploymentConstants { // Ropsten & Rinkeby WETH9 Address // address constant private WETH_ADDRESS = address(0xc778417e063141139fce010982780140aa0cd5ab); - // Mainnet Weth Asset Data - bytes constant private WETH_ASSET_DATA = hex"f47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"; - - // Kovan Weth Asset Data - // bytes constant private WETH_ASSET_DATA = hex"f47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c"; - - // Ropsten & Rinkeby Weth Asset Data - // bytes constant private WETH_ASSET_DATA = hex"f47261b0000000000000000000000000c778417e063141139fce010982780140aa0cd5ab"; - // @TODO SET THESE VALUES FOR DEPLOYMENT - address constant private WETH_ASSET_PROXY_ADDRESS = address(1); address constant private ZRX_VAULT_ADDRESS = address(1); /// @dev An overridable way to access the deployed WETH contract. @@ -62,30 +51,6 @@ contract MixinDeploymentConstants { return wethContract; } - /// @dev An overridable way to access the deployed WETH assetData. - /// Must be view to allow overrides to access state. - /// @return wethAssetData The assetData of the configured WETH contract. - function getWethAssetData() - public - view - returns (bytes memory wethAssetData) - { - wethAssetData = WETH_ASSET_DATA; - return wethAssetData; - } - - /// @dev An overridable way to access the deployed WETH assetProxy. - /// Must be view to allow overrides to access state. - /// @return wethAssetProxy The assetProxy used to transfer WETH. - function getWethAssetProxy() - public - view - returns (IAssetProxy wethAssetProxy) - { - wethAssetProxy = IAssetProxy(WETH_ASSET_PROXY_ADDRESS); - return wethAssetProxy; - } - /// @dev An overridable way to access the deployed zrxVault. /// Must be view to allow overrides to access state. /// @return zrxVault The zrxVault contract.