Remove MConstants and MixinConstants for LibConstants
This commit is contained in:
parent
e20f3a0f97
commit
45d68285f1
@ -21,14 +21,14 @@ pragma experimental ABIEncoderV2;
|
|||||||
|
|
||||||
import "./MixinWeth.sol";
|
import "./MixinWeth.sol";
|
||||||
import "./MixinForwarderCore.sol";
|
import "./MixinForwarderCore.sol";
|
||||||
import "./MixinConstants.sol";
|
import "./libs/LibConstants.sol";
|
||||||
import "./MixinAssets.sol";
|
import "./MixinAssets.sol";
|
||||||
import "./MixinExchangeWrapper.sol";
|
import "./MixinExchangeWrapper.sol";
|
||||||
|
|
||||||
|
|
||||||
// solhint-disable no-empty-blocks
|
// solhint-disable no-empty-blocks
|
||||||
contract Forwarder is
|
contract Forwarder is
|
||||||
MixinConstants,
|
LibConstants,
|
||||||
MixinWeth,
|
MixinWeth,
|
||||||
MixinAssets,
|
MixinAssets,
|
||||||
MixinExchangeWrapper,
|
MixinExchangeWrapper,
|
||||||
@ -43,7 +43,7 @@ contract Forwarder is
|
|||||||
bytes memory _wethAssetData
|
bytes memory _wethAssetData
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
MixinConstants(
|
LibConstants(
|
||||||
_exchange,
|
_exchange,
|
||||||
_etherToken,
|
_etherToken,
|
||||||
_zrxToken,
|
_zrxToken,
|
||||||
|
@ -22,13 +22,13 @@ import "../utils/LibBytes/LibBytes.sol";
|
|||||||
import "../utils/Ownable/Ownable.sol";
|
import "../utils/Ownable/Ownable.sol";
|
||||||
import "../tokens/ERC20Token/IERC20Token.sol";
|
import "../tokens/ERC20Token/IERC20Token.sol";
|
||||||
import "../tokens/ERC721Token/IERC721Token.sol";
|
import "../tokens/ERC721Token/IERC721Token.sol";
|
||||||
|
import "./libs/LibConstants.sol";
|
||||||
import "./mixins/MAssets.sol";
|
import "./mixins/MAssets.sol";
|
||||||
import "./mixins/MConstants.sol";
|
|
||||||
|
|
||||||
|
|
||||||
contract MixinAssets is
|
contract MixinAssets is
|
||||||
Ownable,
|
Ownable,
|
||||||
MConstants,
|
LibConstants,
|
||||||
MAssets
|
MAssets
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
pragma solidity 0.4.24;
|
pragma solidity 0.4.24;
|
||||||
pragma experimental ABIEncoderV2;
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
import "./mixins/MConstants.sol";
|
import "./libs/LibConstants.sol";
|
||||||
import "./mixins/MExchangeWrapper.sol";
|
import "./mixins/MExchangeWrapper.sol";
|
||||||
import "../protocol/Exchange/libs/LibAbiEncoder.sol";
|
import "../protocol/Exchange/libs/LibAbiEncoder.sol";
|
||||||
import "../protocol/Exchange/libs/LibOrder.sol";
|
import "../protocol/Exchange/libs/LibOrder.sol";
|
||||||
@ -31,7 +31,7 @@ contract MixinExchangeWrapper is
|
|||||||
LibAbiEncoder,
|
LibAbiEncoder,
|
||||||
LibFillResults,
|
LibFillResults,
|
||||||
LibMath,
|
LibMath,
|
||||||
MConstants,
|
LibConstants,
|
||||||
MExchangeWrapper
|
MExchangeWrapper
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
pragma solidity 0.4.24;
|
pragma solidity 0.4.24;
|
||||||
pragma experimental ABIEncoderV2;
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
|
import "./libs/LibConstants.sol";
|
||||||
import "./mixins/MWeth.sol";
|
import "./mixins/MWeth.sol";
|
||||||
import "./mixins/MAssets.sol";
|
import "./mixins/MAssets.sol";
|
||||||
import "./mixins/MConstants.sol";
|
|
||||||
import "./mixins/MExchangeWrapper.sol";
|
import "./mixins/MExchangeWrapper.sol";
|
||||||
import "./mixins/MForwarderCore.sol";
|
import "./mixins/MForwarderCore.sol";
|
||||||
import "../utils/LibBytes/LibBytes.sol";
|
import "../utils/LibBytes/LibBytes.sol";
|
||||||
@ -33,7 +33,7 @@ import "../protocol/Exchange/libs/LibMath.sol";
|
|||||||
contract MixinForwarderCore is
|
contract MixinForwarderCore is
|
||||||
LibFillResults,
|
LibFillResults,
|
||||||
LibMath,
|
LibMath,
|
||||||
MConstants,
|
LibConstants,
|
||||||
MWeth,
|
MWeth,
|
||||||
MAssets,
|
MAssets,
|
||||||
MExchangeWrapper,
|
MExchangeWrapper,
|
||||||
|
@ -19,13 +19,13 @@
|
|||||||
pragma solidity 0.4.24;
|
pragma solidity 0.4.24;
|
||||||
|
|
||||||
import "../protocol/Exchange/libs/LibMath.sol";
|
import "../protocol/Exchange/libs/LibMath.sol";
|
||||||
import "./mixins/MConstants.sol";
|
import "./libs/LibConstants.sol";
|
||||||
import "./mixins/MWeth.sol";
|
import "./mixins/MWeth.sol";
|
||||||
|
|
||||||
|
|
||||||
contract MixinWeth is
|
contract MixinWeth is
|
||||||
LibMath,
|
LibMath,
|
||||||
MConstants,
|
LibConstants,
|
||||||
MWeth
|
MWeth
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
|
|
||||||
pragma solidity 0.4.24;
|
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
|
contract LibConstants {
|
||||||
MConstants
|
|
||||||
{
|
|
||||||
|
|
||||||
bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256("ERC20Token(address)"));
|
bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256("ERC20Token(address)"));
|
||||||
bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256("ERC721Token(address,uint256,bytes)"));
|
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_FEE_PERCENTAGE = 5 * PERCENTAGE_DENOMINATOR / 100; // 5%
|
||||||
uint256 constant internal MAX_WETH_FILL_PERCENTAGE = 95 * PERCENTAGE_DENOMINATOR / 100; // 95%
|
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 (
|
constructor (
|
||||||
address _exchange,
|
address _exchange,
|
||||||
address _etherToken,
|
address _etherToken,
|
@ -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
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user