Rename calldata to callData because solhint doesn't like calldata (probably reserved keyword) and goes nuts

This commit is contained in:
Leonid Logvinov 2018-11-22 15:55:21 +01:00
parent e339e1182d
commit d142413745
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4

View File

@ -92,53 +92,53 @@ contract ReentrantERC20Token is
LibOrder.Order[] memory orders; LibOrder.Order[] memory orders;
uint256[] memory takerAssetFillAmounts; uint256[] memory takerAssetFillAmounts;
bytes[] memory signatures; bytes[] memory signatures;
bytes memory calldata; bytes memory callData;
// Create calldata for function that corresponds to currentFunctionId // Create callData for function that corresponds to currentFunctionId
if (currentFunctionId == uint8(ExchangeFunction.FILL_ORDER)) { if (currentFunctionId == uint8(ExchangeFunction.FILL_ORDER)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.fillOrder.selector, EXCHANGE.fillOrder.selector,
order, order,
0, 0,
signature signature
); );
} else if (currentFunctionId == uint8(ExchangeFunction.FILL_OR_KILL_ORDER)) { } else if (currentFunctionId == uint8(ExchangeFunction.FILL_OR_KILL_ORDER)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.fillOrKillOrder.selector, EXCHANGE.fillOrKillOrder.selector,
order, order,
0, 0,
signature signature
); );
} else if (currentFunctionId == uint8(ExchangeFunction.BATCH_FILL_ORDERS)) { } else if (currentFunctionId == uint8(ExchangeFunction.BATCH_FILL_ORDERS)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.batchFillOrders.selector, EXCHANGE.batchFillOrders.selector,
orders, orders,
takerAssetFillAmounts, takerAssetFillAmounts,
signatures signatures
); );
} else if (currentFunctionId == uint8(ExchangeFunction.BATCH_FILL_OR_KILL_ORDERS)) { } else if (currentFunctionId == uint8(ExchangeFunction.BATCH_FILL_OR_KILL_ORDERS)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.batchFillOrKillOrders.selector, EXCHANGE.batchFillOrKillOrders.selector,
orders, orders,
takerAssetFillAmounts, takerAssetFillAmounts,
signatures signatures
); );
} else if (currentFunctionId == uint8(ExchangeFunction.MARKET_BUY_ORDERS)) { } else if (currentFunctionId == uint8(ExchangeFunction.MARKET_BUY_ORDERS)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.marketBuyOrders.selector, EXCHANGE.marketBuyOrders.selector,
orders, orders,
0, 0,
signatures signatures
); );
} else if (currentFunctionId == uint8(ExchangeFunction.MARKET_SELL_ORDERS)) { } else if (currentFunctionId == uint8(ExchangeFunction.MARKET_SELL_ORDERS)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.marketSellOrders.selector, EXCHANGE.marketSellOrders.selector,
orders, orders,
0, 0,
signatures signatures
); );
} else if (currentFunctionId == uint8(ExchangeFunction.MATCH_ORDERS)) { } else if (currentFunctionId == uint8(ExchangeFunction.MATCH_ORDERS)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.matchOrders.selector, EXCHANGE.matchOrders.selector,
order, order,
order, order,
@ -146,22 +146,22 @@ contract ReentrantERC20Token is
signature signature
); );
} else if (currentFunctionId == uint8(ExchangeFunction.CANCEL_ORDER)) { } else if (currentFunctionId == uint8(ExchangeFunction.CANCEL_ORDER)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.cancelOrder.selector, EXCHANGE.cancelOrder.selector,
order order
); );
} else if (currentFunctionId == uint8(ExchangeFunction.BATCH_CANCEL_ORDERS)) { } else if (currentFunctionId == uint8(ExchangeFunction.BATCH_CANCEL_ORDERS)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.batchCancelOrders.selector, EXCHANGE.batchCancelOrders.selector,
orders orders
); );
} else if (currentFunctionId == uint8(ExchangeFunction.CANCEL_ORDERS_UP_TO)) { } else if (currentFunctionId == uint8(ExchangeFunction.CANCEL_ORDERS_UP_TO)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.cancelOrdersUpTo.selector, EXCHANGE.cancelOrdersUpTo.selector,
0 0
); );
} else if (currentFunctionId == uint8(ExchangeFunction.SET_SIGNATURE_VALIDATOR_APPROVAL)) { } else if (currentFunctionId == uint8(ExchangeFunction.SET_SIGNATURE_VALIDATOR_APPROVAL)) {
calldata = abi.encodeWithSelector( callData = abi.encodeWithSelector(
EXCHANGE.setSignatureValidatorApproval.selector, EXCHANGE.setSignatureValidatorApproval.selector,
address(0), address(0),
false false
@ -169,7 +169,7 @@ contract ReentrantERC20Token is
} }
// Call Exchange function, swallow error // Call Exchange function, swallow error
address(EXCHANGE).call(calldata); address(EXCHANGE).call(callData);
// Revert reason is 100 bytes // Revert reason is 100 bytes
bytes memory returnData = new bytes(100); bytes memory returnData = new bytes(100);