@0x/contracts-exchange
: Light changes to address PR comments.
This commit is contained in:
@@ -78,9 +78,10 @@ contract MixinWrapperFunctions is
|
||||
signature
|
||||
);
|
||||
|
||||
(bool didSucceed, bytes memory resultData) = address(this).delegatecall(fillOrderCalldata);
|
||||
(bool didSucceed, bytes memory returnData) = address(this).delegatecall(fillOrderCalldata);
|
||||
if (didSucceed) {
|
||||
fillResults = abi.decode(resultData, (FillResults));
|
||||
assert(returnData == 128);
|
||||
fillResults = abi.decode(returnData, (FillResults));
|
||||
}
|
||||
// fillResults values will be 0 by default if call was unsuccessful
|
||||
return fillResults;
|
||||
@@ -187,7 +188,7 @@ contract MixinWrapperFunctions is
|
||||
orders[i].takerAssetData = takerAssetData;
|
||||
|
||||
// Calculate the remaining amount of takerAsset to sell
|
||||
uint256 remainingTakerAssetFillAmount = takerAssetFillAmount - fillResults.takerAssetFilledAmount;
|
||||
uint256 remainingTakerAssetFillAmount = _safeSub(takerAssetFillAmount, fillResults.takerAssetFilledAmount);
|
||||
|
||||
// Attempt to sell the remaining amount of takerAsset
|
||||
FillResults memory singleFillResults = fillOrderNoThrow(
|
||||
|
@@ -91,8 +91,7 @@ contract IWrapperFunctions {
|
||||
public
|
||||
returns (LibFillResults.FillResults[] memory fillResults);
|
||||
|
||||
/// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.
|
||||
/// Returns false if the transaction would otherwise revert.
|
||||
/// @dev Executes multiple calls of fillOrderNoThrow until total amount of takerAsset is sold by taker.
|
||||
/// @param orders Array of order specifications.
|
||||
/// @param takerAssetFillAmount Desired amount of takerAsset to sell.
|
||||
/// @param signatures Proofs that orders have been signed by makers.
|
||||
@@ -105,8 +104,7 @@ contract IWrapperFunctions {
|
||||
public
|
||||
returns (LibFillResults.FillResults memory fillResults);
|
||||
|
||||
/// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.
|
||||
/// Returns false if the transaction would otherwise revert.
|
||||
/// @dev Executes multiple calls of fillOrderNoThrow until total amount of makerAsset is bought by taker.
|
||||
/// @param orders Array of order specifications.
|
||||
/// @param makerAssetFillAmount Desired amount of makerAsset to buy.
|
||||
/// @param signatures Proofs that orders have been signed by makers.
|
||||
|
@@ -36,6 +36,7 @@ contract ReentrancyTester is
|
||||
// solhint-disable no-unused-vars
|
||||
constructor ()
|
||||
public
|
||||
// Initialize the exchange with a fixed chainId ("test" in hex).
|
||||
Exchange(0x74657374)
|
||||
{}
|
||||
|
||||
|
@@ -172,7 +172,7 @@ contract TestValidatorWallet is
|
||||
{
|
||||
ValidatorAction action = _hashActions[hash];
|
||||
if (action == ValidatorAction.Reject) {
|
||||
magicValue = 0x0;
|
||||
magicValue = bytes4(0);
|
||||
} else if (action == ValidatorAction.Accept) {
|
||||
magicValue = LEGACY_WALLET_MAGIC_VALUE;
|
||||
} else if (action == ValidatorAction.Revert) {
|
||||
|
@@ -24,7 +24,7 @@ export enum ExchangeFunctionName {
|
||||
MarketBuyOrders = 'marketBuyOrders',
|
||||
MarketSellOrders = 'marketSellOrders',
|
||||
MatchOrders = 'matchOrders',
|
||||
MatchOrdersWithMaximalfill = 'matchOrdersWithMaximalFill',
|
||||
MatchOrdersWithMaximalFill = 'matchOrdersWithMaximalFill',
|
||||
PreSign = 'preSign',
|
||||
RegisterAssetProxy = 'registerAssetProxy',
|
||||
SetSignatureValidatorApproval = 'setSignatureValidatorApproval',
|
||||
|
Reference in New Issue
Block a user