aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/2.0.0
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-09-04 11:35:00 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-09-04 11:35:00 +0800
commitcb4fcf4de7b9decad05536f2edf1c1ffd8666a72 (patch)
tree9dabe3fdf180fe808ace6a739662944dfff98739 /packages/contracts/src/2.0.0
parent675964dc5c6c44eb07023fd036857ecd3f14dcf3 (diff)
downloaddexon-sol-tools-cb4fcf4de7b9decad05536f2edf1c1ffd8666a72.tar
dexon-sol-tools-cb4fcf4de7b9decad05536f2edf1c1ffd8666a72.tar.gz
dexon-sol-tools-cb4fcf4de7b9decad05536f2edf1c1ffd8666a72.tar.bz2
dexon-sol-tools-cb4fcf4de7b9decad05536f2edf1c1ffd8666a72.tar.lz
dexon-sol-tools-cb4fcf4de7b9decad05536f2edf1c1ffd8666a72.tar.xz
dexon-sol-tools-cb4fcf4de7b9decad05536f2edf1c1ffd8666a72.tar.zst
dexon-sol-tools-cb4fcf4de7b9decad05536f2edf1c1ffd8666a72.zip
Revert in Forwarder constructor if ERC20 proxy isn't registered
Diffstat (limited to 'packages/contracts/src/2.0.0')
-rw-r--r--packages/contracts/src/2.0.0/extensions/Forwarder/MixinForwarderCore.sol11
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinForwarderCore.sol b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinForwarderCore.sol
index 14f191879..54487f726 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinForwarderCore.sol
+++ b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinForwarderCore.sol
@@ -39,7 +39,6 @@ contract MixinForwarderCore is
MExchangeWrapper,
IForwarderCore
{
-
using LibBytes for bytes;
/// @dev Constructor approves ERC20 proxy to transfer ZRX and WETH on this contract's behalf.
@@ -47,10 +46,12 @@ contract MixinForwarderCore is
public
{
address proxyAddress = EXCHANGE.getAssetProxy(ERC20_DATA_ID);
- if (proxyAddress != address(0)) {
- ETHER_TOKEN.approve(proxyAddress, MAX_UINT);
- ZRX_TOKEN.approve(proxyAddress, MAX_UINT);
- }
+ require(
+ proxyAddress != address(0),
+ "UNREGISTERED_ASSET_PROXY"
+ );
+ ETHER_TOKEN.approve(proxyAddress, MAX_UINT);
+ ZRX_TOKEN.approve(proxyAddress, MAX_UINT);
}
/// @dev Purchases as much of orders' makerAssets as possible by selling up to 95% of transaction's ETH value.