Remove MConstants and MixinConstants for LibConstants

This commit is contained in:
Amir Bandeali 2018-07-22 19:35:20 -05:00
parent e20f3a0f97
commit 45d68285f1
8 changed files with 23 additions and 57 deletions

View File

@ -21,14 +21,14 @@ pragma experimental ABIEncoderV2;
import "./MixinWeth.sol";
import "./MixinForwarderCore.sol";
import "./MixinConstants.sol";
import "./libs/LibConstants.sol";
import "./MixinAssets.sol";
import "./MixinExchangeWrapper.sol";
// solhint-disable no-empty-blocks
contract Forwarder is
MixinConstants,
LibConstants,
MixinWeth,
MixinAssets,
MixinExchangeWrapper,
@ -43,7 +43,7 @@ contract Forwarder is
bytes memory _wethAssetData
)
public
MixinConstants(
LibConstants(
_exchange,
_etherToken,
_zrxToken,

View File

@ -22,13 +22,13 @@ import "../utils/LibBytes/LibBytes.sol";
import "../utils/Ownable/Ownable.sol";
import "../tokens/ERC20Token/IERC20Token.sol";
import "../tokens/ERC721Token/IERC721Token.sol";
import "./libs/LibConstants.sol";
import "./mixins/MAssets.sol";
import "./mixins/MConstants.sol";
contract MixinAssets is
Ownable,
MConstants,
LibConstants,
MAssets
{

View File

@ -19,7 +19,7 @@
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
import "./mixins/MConstants.sol";
import "./libs/LibConstants.sol";
import "./mixins/MExchangeWrapper.sol";
import "../protocol/Exchange/libs/LibAbiEncoder.sol";
import "../protocol/Exchange/libs/LibOrder.sol";
@ -31,7 +31,7 @@ contract MixinExchangeWrapper is
LibAbiEncoder,
LibFillResults,
LibMath,
MConstants,
LibConstants,
MExchangeWrapper
{

View File

@ -19,9 +19,9 @@
pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
import "./libs/LibConstants.sol";
import "./mixins/MWeth.sol";
import "./mixins/MAssets.sol";
import "./mixins/MConstants.sol";
import "./mixins/MExchangeWrapper.sol";
import "./mixins/MForwarderCore.sol";
import "../utils/LibBytes/LibBytes.sol";
@ -33,7 +33,7 @@ import "../protocol/Exchange/libs/LibMath.sol";
contract MixinForwarderCore is
LibFillResults,
LibMath,
MConstants,
LibConstants,
MWeth,
MAssets,
MExchangeWrapper,

View File

@ -19,13 +19,13 @@
pragma solidity 0.4.24;
import "../protocol/Exchange/libs/LibMath.sol";
import "./mixins/MConstants.sol";
import "./libs/LibConstants.sol";
import "./mixins/MWeth.sol";
contract MixinWeth is
LibMath,
MConstants,
LibConstants,
MWeth
{

View File

@ -18,12 +18,12 @@
pragma solidity 0.4.24;
import "./mixins/MConstants.sol";
import "../../protocol/Exchange/interfaces/IExchange.sol";
import "../../tokens/EtherToken/IEtherToken.sol";
import "../../tokens/ERC20Token/IERC20Token.sol";
contract MixinConstants is
MConstants
{
contract LibConstants {
bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256("ERC20Token(address)"));
bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256("ERC721Token(address,uint256,bytes)"));
@ -32,6 +32,14 @@ contract MixinConstants is
uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%
uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%
// solhint-disable var-name-mixedcase
IExchange internal EXCHANGE;
IEtherToken internal ETHER_TOKEN;
IERC20Token internal ZRX_TOKEN;
bytes internal ZRX_ASSET_DATA;
bytes internal WETH_ASSET_DATA;
// solhint-enable var-name-mixedcase
constructor (
address _exchange,
address _etherToken,

View File

@ -1,42 +0,0 @@
/*
Copyright 2018 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.4.24;
import "../../protocol/Exchange/interfaces/IExchange.sol";
import "../../tokens/EtherToken/IEtherToken.sol";
import "../../tokens/ERC20Token/IERC20Token.sol";
contract MConstants {
bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256("ERC20Token(address)"));
bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256("ERC721Token(address,uint256,bytes)"));
uint256 constant internal MAX_UINT = 2**256 - 1;
uint256 constant internal PERCENTAGE_DENOMINATOR = 10**18;
uint256 constant internal MAX_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%
uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%
// solhint-disable var-name-mixedcase
IExchange internal EXCHANGE;
IEtherToken internal ETHER_TOKEN;
IERC20Token internal ZRX_TOKEN;
bytes internal ZRX_ASSET_DATA;
bytes internal WETH_ASSET_DATA;
// solhint-enable var-name-mixedcase
}