aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-07-23 08:35:20 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-07-23 23:02:51 +0800
commit45d68285f14ba328e1bf5a8cc9e59cdb39d7f306 (patch)
tree59d220b789185be67ac5f4653d31b9752c903fa5 /packages/contracts
parente20f3a0f97d3d2029aea24e761d4689e0382756f (diff)
downloaddexon-sol-tools-45d68285f14ba328e1bf5a8cc9e59cdb39d7f306.tar.gz
dexon-sol-tools-45d68285f14ba328e1bf5a8cc9e59cdb39d7f306.tar.zst
dexon-sol-tools-45d68285f14ba328e1bf5a8cc9e59cdb39d7f306.zip
Remove MConstants and MixinConstants for LibConstants
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/src/2.0.0/forwarder/Forwarder.sol6
-rw-r--r--packages/contracts/src/2.0.0/forwarder/MixinAssets.sol4
-rw-r--r--packages/contracts/src/2.0.0/forwarder/MixinExchangeWrapper.sol4
-rw-r--r--packages/contracts/src/2.0.0/forwarder/MixinForwarderCore.sol4
-rw-r--r--packages/contracts/src/2.0.0/forwarder/MixinWeth.sol4
-rw-r--r--packages/contracts/src/2.0.0/forwarder/libs/LibConstants.sol (renamed from packages/contracts/src/2.0.0/forwarder/MixinConstants.sol)16
-rw-r--r--packages/contracts/src/2.0.0/forwarder/libs/LibForwarderErrors.sol (renamed from packages/contracts/src/2.0.0/forwarder/LibForwarderErrors.sol)0
-rw-r--r--packages/contracts/src/2.0.0/forwarder/mixins/MConstants.sol42
8 files changed, 23 insertions, 57 deletions
diff --git a/packages/contracts/src/2.0.0/forwarder/Forwarder.sol b/packages/contracts/src/2.0.0/forwarder/Forwarder.sol
index d3721884c..5b88b05b1 100644
--- a/packages/contracts/src/2.0.0/forwarder/Forwarder.sol
+++ b/packages/contracts/src/2.0.0/forwarder/Forwarder.sol
@@ -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,
diff --git a/packages/contracts/src/2.0.0/forwarder/MixinAssets.sol b/packages/contracts/src/2.0.0/forwarder/MixinAssets.sol
index 44809ed85..084a28550 100644
--- a/packages/contracts/src/2.0.0/forwarder/MixinAssets.sol
+++ b/packages/contracts/src/2.0.0/forwarder/MixinAssets.sol
@@ -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
{
diff --git a/packages/contracts/src/2.0.0/forwarder/MixinExchangeWrapper.sol b/packages/contracts/src/2.0.0/forwarder/MixinExchangeWrapper.sol
index 5c0a606e6..d80e06350 100644
--- a/packages/contracts/src/2.0.0/forwarder/MixinExchangeWrapper.sol
+++ b/packages/contracts/src/2.0.0/forwarder/MixinExchangeWrapper.sol
@@ -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
{
diff --git a/packages/contracts/src/2.0.0/forwarder/MixinForwarderCore.sol b/packages/contracts/src/2.0.0/forwarder/MixinForwarderCore.sol
index e9acef7a2..1164ae919 100644
--- a/packages/contracts/src/2.0.0/forwarder/MixinForwarderCore.sol
+++ b/packages/contracts/src/2.0.0/forwarder/MixinForwarderCore.sol
@@ -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,
diff --git a/packages/contracts/src/2.0.0/forwarder/MixinWeth.sol b/packages/contracts/src/2.0.0/forwarder/MixinWeth.sol
index b566c3ef6..a50863a59 100644
--- a/packages/contracts/src/2.0.0/forwarder/MixinWeth.sol
+++ b/packages/contracts/src/2.0.0/forwarder/MixinWeth.sol
@@ -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
{
diff --git a/packages/contracts/src/2.0.0/forwarder/MixinConstants.sol b/packages/contracts/src/2.0.0/forwarder/libs/LibConstants.sol
index e430aba41..8abe1e42d 100644
--- a/packages/contracts/src/2.0.0/forwarder/MixinConstants.sol
+++ b/packages/contracts/src/2.0.0/forwarder/libs/LibConstants.sol
@@ -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,
diff --git a/packages/contracts/src/2.0.0/forwarder/LibForwarderErrors.sol b/packages/contracts/src/2.0.0/forwarder/libs/LibForwarderErrors.sol
index 69108738a..69108738a 100644
--- a/packages/contracts/src/2.0.0/forwarder/LibForwarderErrors.sol
+++ b/packages/contracts/src/2.0.0/forwarder/libs/LibForwarderErrors.sol
diff --git a/packages/contracts/src/2.0.0/forwarder/mixins/MConstants.sol b/packages/contracts/src/2.0.0/forwarder/mixins/MConstants.sol
deleted file mode 100644
index 712a11c5d..000000000
--- a/packages/contracts/src/2.0.0/forwarder/mixins/MConstants.sol
+++ /dev/null
@@ -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
-}