Update contracts/exchange-forwarder to 0.5.5 (#1796)

* Cherry-pick updated `@0x/contracts-exchange-forwarder` from `3.0` branch.

* Add PR numbers to changelogs
This commit is contained in:
Lawrence Forman 2019-04-28 22:21:13 -04:00 committed by GitHub
parent d303e9f347
commit bbc06be091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 59 additions and 49 deletions

View File

@ -1,4 +1,13 @@
[ [
{
"version": "3.0.0",
"changes": [
{
"note": "Update contracts to solidity ^0.5.5 and unpin dependencies",
"pr": 1796
}
]
},
{ {
"version": "2.1.1", "version": "2.1.1",
"changes": [ "changes": [

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity 0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "./MixinWeth.sol"; import "./MixinWeth.sol";
@ -40,6 +40,7 @@ contract Forwarder is
bytes memory _wethAssetData bytes memory _wethAssetData
) )
public public
Ownable()
LibConstants( LibConstants(
_exchange, _exchange,
_zrxAssetData, _zrxAssetData,

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/LibBytes.sol"; import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "@0x/contracts-utils/contracts/src/Ownable.sol"; import "@0x/contracts-utils/contracts/src/Ownable.sol";
@ -41,7 +41,7 @@ contract MixinAssets is
/// @param assetData Byte array encoded for the respective asset proxy. /// @param assetData Byte array encoded for the respective asset proxy.
/// @param amount Amount of ERC20 token to withdraw. /// @param amount Amount of ERC20 token to withdraw.
function withdrawAsset( function withdrawAsset(
bytes assetData, bytes calldata assetData,
uint256 amount uint256 amount
) )
external external
@ -84,7 +84,7 @@ contract MixinAssets is
// Transfer tokens. // Transfer tokens.
// We do a raw call so we can check the success separate // We do a raw call so we can check the success separate
// from the return data. // from the return data.
bool success = token.call(abi.encodeWithSelector( (bool success,) = token.call(abi.encodeWithSelector(
ERC20_TRANSFER_SELECTOR, ERC20_TRANSFER_SELECTOR,
msg.sender, msg.sender,
amount amount

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "./libs/LibConstants.sol"; import "./libs/LibConstants.sol";
@ -144,6 +144,7 @@ contract MixinExchangeWrapper is
bytes memory wethAssetData = WETH_ASSET_DATA; bytes memory wethAssetData = WETH_ASSET_DATA;
uint256 ordersLength = orders.length; uint256 ordersLength = orders.length;
uint256 makerAssetFilledAmount = 0;
for (uint256 i = 0; i != ordersLength; i++) { for (uint256 i = 0; i != ordersLength; i++) {
// We assume that asset being bought by taker is the same for each order. // We assume that asset being bought by taker is the same for each order.
@ -175,7 +176,7 @@ contract MixinExchangeWrapper is
addFillResults(totalFillResults, singleFillResults); addFillResults(totalFillResults, singleFillResults);
// Stop execution if the entire amount of makerAsset has been bought // Stop execution if the entire amount of makerAsset has been bought
uint256 makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount; makerAssetFilledAmount = totalFillResults.makerAssetFilledAmount;
if (makerAssetFilledAmount >= makerAssetFillAmount) { if (makerAssetFilledAmount >= makerAssetFillAmount) {
break; break;
} }

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "./libs/LibConstants.sol"; import "./libs/LibConstants.sol";
@ -70,8 +70,8 @@ contract MixinForwarderCore is
bytes[] memory signatures, bytes[] memory signatures,
LibOrder.Order[] memory feeOrders, LibOrder.Order[] memory feeOrders,
bytes[] memory feeSignatures, bytes[] memory feeSignatures,
uint256 feePercentage, uint256 feePercentage,
address feeRecipient address payable feeRecipient
) )
public public
payable payable
@ -156,8 +156,8 @@ contract MixinForwarderCore is
bytes[] memory signatures, bytes[] memory signatures,
LibOrder.Order[] memory feeOrders, LibOrder.Order[] memory feeOrders,
bytes[] memory feeSignatures, bytes[] memory feeSignatures,
uint256 feePercentage, uint256 feePercentage,
address feeRecipient address payable feeRecipient
) )
public public
payable payable

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "@0x/contracts-exchange-libs/contracts/src/LibMath.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibMath.sol";
import "./libs/LibConstants.sol"; import "./libs/LibConstants.sol";
@ -30,7 +30,7 @@ contract MixinWeth is
{ {
/// @dev Default payabale function, this allows us to withdraw WETH /// @dev Default payabale function, this allows us to withdraw WETH
function () function ()
public external
payable payable
{ {
require( require(
@ -60,7 +60,7 @@ contract MixinWeth is
uint256 wethSoldExcludingFeeOrders, uint256 wethSoldExcludingFeeOrders,
uint256 wethSoldForZrx, uint256 wethSoldForZrx,
uint256 feePercentage, uint256 feePercentage,
address feeRecipient address payable feeRecipient
) )
internal internal
{ {

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
contract IAssets { contract IAssets {
@ -27,7 +27,7 @@ contract IAssets {
/// @param assetData Byte array encoded for the respective asset proxy. /// @param assetData Byte array encoded for the respective asset proxy.
/// @param amount Amount of ERC20 token to withdraw. /// @param amount Amount of ERC20 token to withdraw.
function withdrawAsset( function withdrawAsset(
bytes assetData, bytes calldata assetData,
uint256 amount uint256 amount
) )
external; external;

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "./IForwarderCore.sol"; import "./IForwarderCore.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
@ -41,8 +41,8 @@ contract IForwarderCore {
bytes[] memory signatures, bytes[] memory signatures,
LibOrder.Order[] memory feeOrders, LibOrder.Order[] memory feeOrders,
bytes[] memory feeSignatures, bytes[] memory feeSignatures,
uint256 feePercentage, uint256 feePercentage,
address feeRecipient address payable feeRecipient
) )
public public
payable payable
@ -68,8 +68,8 @@ contract IForwarderCore {
bytes[] memory signatures, bytes[] memory signatures,
LibOrder.Order[] memory feeOrders, LibOrder.Order[] memory feeOrders,
bytes[] memory feeSignatures, bytes[] memory feeSignatures,
uint256 feePercentage, uint256 feePercentage,
address feeRecipient address payable feeRecipient
) )
public public
payable payable

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "@0x/contracts-utils/contracts/src/LibBytes.sol"; import "@0x/contracts-utils/contracts/src/LibBytes.sol";
import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol"; import "@0x/contracts-exchange/contracts/src/interfaces/IExchange.sol";

View File

@ -17,7 +17,7 @@
*/ */
// solhint-disable // solhint-disable
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
/// This contract is intended to serve as a reference, but is not actually used for efficiency reasons. /// This contract is intended to serve as a reference, but is not actually used for efficiency reasons.

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
import "../interfaces/IAssets.sol"; import "../interfaces/IAssets.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol"; import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";

View File

@ -16,7 +16,7 @@
*/ */
pragma solidity ^0.4.24; pragma solidity ^0.5.5;
contract MWeth { contract MWeth {
@ -35,7 +35,7 @@ contract MWeth {
uint256 wethSoldExcludingFeeOrders, uint256 wethSoldExcludingFeeOrders,
uint256 wethSoldForZrx, uint256 wethSoldForZrx,
uint256 feePercentage, uint256 feePercentage,
address feeRecipient address payable feeRecipient
) )
internal; internal;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@0x/contracts-exchange-forwarder", "name": "@0x/contracts-exchange-forwarder",
"version": "2.1.1", "version": "2.1.0",
"engines": { "engines": {
"node": ">=6.12" "node": ">=6.12"
}, },
@ -24,7 +24,6 @@
"clean": "shx rm -rf lib generated-artifacts generated-wrappers", "clean": "shx rm -rf lib generated-artifacts generated-wrappers",
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers", "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts", "lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
"fix": "tslint --fix --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
"coverage:report:text": "istanbul report text", "coverage:report:text": "istanbul report text",
"coverage:report:html": "istanbul report html && open coverage/index.html", "coverage:report:html": "istanbul report html && open coverage/index.html",
"profiler:report:html": "istanbul report html && open coverage/index.html", "profiler:report:html": "istanbul report html && open coverage/index.html",
@ -71,14 +70,14 @@
"dependencies": { "dependencies": {
"@0x/base-contract": "^5.0.5", "@0x/base-contract": "^5.0.5",
"@0x/contracts-asset-proxy": "^2.1.1", "@0x/contracts-asset-proxy": "^2.1.1",
"@0x/contracts-erc20": "1.0.8", "@0x/contracts-erc20": "^2.2.0",
"@0x/contracts-erc721": "1.0.8", "@0x/contracts-erc721": "^2.1.0",
"@0x/contracts-exchange": "1.0.2", "@0x/contracts-exchange": "^2.1.1",
"@0x/contracts-exchange-libs": "1.0.2", "@0x/contracts-exchange-libs": "^2.1.1",
"@0x/contracts-utils": "2.0.1", "@0x/contracts-utils": "^3.1.1",
"@0x/order-utils": "^7.2.0", "@0x/order-utils": "^7.2.0",
"@0x/types": "^2.2.2", "@0x/types": "^2.2.2",
"@0x/typescript-typings": "^4.2.2", "@0x/typescript-typings": "^4.2.1",
"@0x/utils": "^4.3.1", "@0x/utils": "^4.3.1",
"@0x/web3-wrapper": "^6.0.5", "@0x/web3-wrapper": "^6.0.5",
"ethereum-types": "^2.1.2", "ethereum-types": "^2.1.2",