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",
"changes": [

View File

@ -16,7 +16,7 @@
*/
pragma solidity 0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "./MixinWeth.sol";
@ -40,6 +40,7 @@ contract Forwarder is
bytes memory _wethAssetData
)
public
Ownable()
LibConstants(
_exchange,
_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/Ownable.sol";
@ -41,7 +41,7 @@ contract MixinAssets is
/// @param assetData Byte array encoded for the respective asset proxy.
/// @param amount Amount of ERC20 token to withdraw.
function withdrawAsset(
bytes assetData,
bytes calldata assetData,
uint256 amount
)
external
@ -84,7 +84,7 @@ contract MixinAssets is
// Transfer tokens.
// We do a raw call so we can check the success separate
// from the return data.
bool success = token.call(abi.encodeWithSelector(
(bool success,) = token.call(abi.encodeWithSelector(
ERC20_TRANSFER_SELECTOR,
msg.sender,
amount

View File

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

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "./libs/LibConstants.sol";
@ -71,7 +71,7 @@ contract MixinForwarderCore is
LibOrder.Order[] memory feeOrders,
bytes[] memory feeSignatures,
uint256 feePercentage,
address feeRecipient
address payable feeRecipient
)
public
payable
@ -157,7 +157,7 @@ contract MixinForwarderCore is
LibOrder.Order[] memory feeOrders,
bytes[] memory feeSignatures,
uint256 feePercentage,
address feeRecipient
address payable feeRecipient
)
public
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 "./libs/LibConstants.sol";
@ -30,7 +30,7 @@ contract MixinWeth is
{
/// @dev Default payabale function, this allows us to withdraw WETH
function ()
public
external
payable
{
require(
@ -60,7 +60,7 @@ contract MixinWeth is
uint256 wethSoldExcludingFeeOrders,
uint256 wethSoldForZrx,
uint256 feePercentage,
address feeRecipient
address payable feeRecipient
)
internal
{

View File

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

View File

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

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
@ -42,7 +42,7 @@ contract IForwarderCore {
LibOrder.Order[] memory feeOrders,
bytes[] memory feeSignatures,
uint256 feePercentage,
address feeRecipient
address payable feeRecipient
)
public
payable
@ -69,7 +69,7 @@ contract IForwarderCore {
LibOrder.Order[] memory feeOrders,
bytes[] memory feeSignatures,
uint256 feePercentage,
address feeRecipient
address payable feeRecipient
)
public
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-exchange/contracts/src/interfaces/IExchange.sol";

View File

@ -17,7 +17,7 @@
*/
// 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.

View File

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

View File

@ -16,7 +16,7 @@
*/
pragma solidity ^0.4.24;
pragma solidity ^0.5.5;
pragma experimental ABIEncoderV2;
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 {
@ -35,7 +35,7 @@ contract MWeth {
uint256 wethSoldExcludingFeeOrders,
uint256 wethSoldForZrx,
uint256 feePercentage,
address feeRecipient
address payable feeRecipient
)
internal;
}

View File

@ -1,6 +1,6 @@
{
"name": "@0x/contracts-exchange-forwarder",
"version": "2.1.1",
"version": "2.1.0",
"engines": {
"node": ">=6.12"
},
@ -24,7 +24,6 @@
"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",
"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:html": "istanbul report html && open coverage/index.html",
"profiler:report:html": "istanbul report html && open coverage/index.html",
@ -71,14 +70,14 @@
"dependencies": {
"@0x/base-contract": "^5.0.5",
"@0x/contracts-asset-proxy": "^2.1.1",
"@0x/contracts-erc20": "1.0.8",
"@0x/contracts-erc721": "1.0.8",
"@0x/contracts-exchange": "1.0.2",
"@0x/contracts-exchange-libs": "1.0.2",
"@0x/contracts-utils": "2.0.1",
"@0x/contracts-erc20": "^2.2.0",
"@0x/contracts-erc721": "^2.1.0",
"@0x/contracts-exchange": "^2.1.1",
"@0x/contracts-exchange-libs": "^2.1.1",
"@0x/contracts-utils": "^3.1.1",
"@0x/order-utils": "^7.2.0",
"@0x/types": "^2.2.2",
"@0x/typescript-typings": "^4.2.2",
"@0x/typescript-typings": "^4.2.1",
"@0x/utils": "^4.3.1",
"@0x/web3-wrapper": "^6.0.5",
"ethereum-types": "^2.1.2",