aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/2.0.0/extensions
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-09-05 01:53:18 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-09-05 01:53:18 +0800
commite61dbbb6cf395d3bf807340cac8f99f224ec616e (patch)
tree04cbe061658c4062423aa6ac40c0968c5b250c90 /packages/contracts/src/2.0.0/extensions
parent11df29fa8e4f355ec438966fa9e40cb09fe97380 (diff)
parent6a619a4084188d1c48d8030d0fe2a1ba777c55e3 (diff)
downloaddexon-sol-tools-e61dbbb6cf395d3bf807340cac8f99f224ec616e.tar
dexon-sol-tools-e61dbbb6cf395d3bf807340cac8f99f224ec616e.tar.gz
dexon-sol-tools-e61dbbb6cf395d3bf807340cac8f99f224ec616e.tar.bz2
dexon-sol-tools-e61dbbb6cf395d3bf807340cac8f99f224ec616e.tar.lz
dexon-sol-tools-e61dbbb6cf395d3bf807340cac8f99f224ec616e.tar.xz
dexon-sol-tools-e61dbbb6cf395d3bf807340cac8f99f224ec616e.tar.zst
dexon-sol-tools-e61dbbb6cf395d3bf807340cac8f99f224ec616e.zip
Merge https://github.com/0xProject/0x-monorepo into feature/website/update-portal-v2
Diffstat (limited to 'packages/contracts/src/2.0.0/extensions')
-rw-r--r--packages/contracts/src/2.0.0/extensions/Forwarder/Forwarder.sol1
-rw-r--r--packages/contracts/src/2.0.0/extensions/Forwarder/MixinAssets.sol1
-rw-r--r--packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol3
-rw-r--r--packages/contracts/src/2.0.0/extensions/Forwarder/MixinForwarderCore.sol11
-rw-r--r--packages/contracts/src/2.0.0/extensions/Forwarder/MixinWeth.sol1
-rw-r--r--packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MAssets.sol1
-rw-r--r--packages/contracts/src/2.0.0/extensions/OrderValidator/OrderValidator.sol4
7 files changed, 9 insertions, 13 deletions
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/Forwarder.sol b/packages/contracts/src/2.0.0/extensions/Forwarder/Forwarder.sol
index 6b17bb29b..94dec40ed 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/Forwarder.sol
+++ b/packages/contracts/src/2.0.0/extensions/Forwarder/Forwarder.sol
@@ -34,7 +34,6 @@ contract Forwarder is
MixinExchangeWrapper,
MixinForwarderCore
{
-
constructor (
address _exchange,
bytes memory _zrxAssetData,
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinAssets.sol b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinAssets.sol
index d6a38aa6e..43efb5ff3 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinAssets.sol
+++ b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinAssets.sol
@@ -31,7 +31,6 @@ contract MixinAssets is
LibConstants,
MAssets
{
-
using LibBytes for bytes;
bytes4 constant internal ERC20_TRANSFER_SELECTOR = bytes4(keccak256("transfer(address,uint256)"));
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol
index 9e816716c..fea9a53c2 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol
+++ b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol
@@ -34,7 +34,6 @@ contract MixinExchangeWrapper is
LibConstants,
MExchangeWrapper
{
-
/// @dev Fills the input order.
/// Returns false if the transaction would otherwise revert.
/// @param order Order struct containing order specifications.
@@ -61,7 +60,7 @@ contract MixinExchangeWrapper is
// Call `fillOrder` and handle any exceptions gracefully
assembly {
let success := call(
- gas, // forward all gas, TODO: look into gas consumption of assert/throw
+ gas, // forward all gas
exchange, // call address of Exchange contract
0, // transfer 0 wei
add(fillOrderCalldata, 32), // pointer to start of input (skip array length in first 32 bytes)
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.
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinWeth.sol b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinWeth.sol
index 5863b522d..d2814a49b 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinWeth.sol
+++ b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinWeth.sol
@@ -28,7 +28,6 @@ contract MixinWeth is
LibConstants,
MWeth
{
-
/// @dev Default payabale function, this allows us to withdraw WETH
function ()
public
diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MAssets.sol b/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MAssets.sol
index 83636432a..9e7f80d97 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MAssets.sol
+++ b/packages/contracts/src/2.0.0/extensions/Forwarder/mixins/MAssets.sol
@@ -24,7 +24,6 @@ import "../interfaces/IAssets.sol";
contract MAssets is
IAssets
{
-
/// @dev Transfers given amount of asset to sender.
/// @param assetData Byte array encoded for the respective asset proxy.
/// @param amount Amount of asset to transfer to sender.
diff --git a/packages/contracts/src/2.0.0/extensions/OrderValidator/OrderValidator.sol b/packages/contracts/src/2.0.0/extensions/OrderValidator/OrderValidator.sol
index a18345245..8bfde3847 100644
--- a/packages/contracts/src/2.0.0/extensions/OrderValidator/OrderValidator.sol
+++ b/packages/contracts/src/2.0.0/extensions/OrderValidator/OrderValidator.sol
@@ -28,11 +28,11 @@ import "../../utils/LibBytes/LibBytes.sol";
contract OrderValidator {
+ using LibBytes for bytes;
+
bytes4 constant internal ERC20_DATA_ID = bytes4(keccak256("ERC20Token(address)"));
bytes4 constant internal ERC721_DATA_ID = bytes4(keccak256("ERC721Token(address,uint256)"));
- using LibBytes for bytes;
-
struct TraderInfo {
uint256 makerBalance; // Maker's balance of makerAsset
uint256 makerAllowance; // Maker's allowance to corresponding AssetProxy