Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contracts cleanup #164

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions contracts/zero-ex/CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
{
"note": "Encoding protocol ID and source name in bridge source ID",
"pr": 162
},
{
"note": "Add PancakeSwapFeature",
"pr": 164
},
{
"note": "Remove TokenSpender/AllowanceTarget/greedy tokens stuff",
"pr": 164
}
]
},
Expand Down
2 changes: 0 additions & 2 deletions contracts/zero-ex/contracts/src/IZeroEx.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pragma experimental ABIEncoderV2;

import "./features/IOwnableFeature.sol";
import "./features/ISimpleFunctionRegistryFeature.sol";
import "./features/ITokenSpenderFeature.sol";
import "./features/ITransformERC20Feature.sol";
import "./features/IMetaTransactionsFeature.sol";
import "./features/IUniswapFeature.sol";
Expand All @@ -34,7 +33,6 @@ import "./features/INativeOrdersFeature.sol";
interface IZeroEx is
IOwnableFeature,
ISimpleFunctionRegistryFeature,
ITokenSpenderFeature,
ITransformERC20Feature,
IMetaTransactionsFeature,
IUniswapFeature,
Expand Down
47 changes: 0 additions & 47 deletions contracts/zero-ex/contracts/src/errors/LibSpenderRichErrors.sol

This file was deleted.

56 changes: 0 additions & 56 deletions contracts/zero-ex/contracts/src/external/AllowanceTarget.sol

This file was deleted.

44 changes: 44 additions & 0 deletions contracts/zero-ex/contracts/src/features/IPancakeSwapFeature.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: Apache-2.0
/*

Copyright 2021 ZeroEx Intl.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

*/

pragma solidity ^0.6.5;
pragma experimental ABIEncoderV2;

import "@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol";


/// @dev VIP uniswap fill functions.
interface IPancakeSwapFeature {

/// @dev Efficiently sell directly to uniswap/sushiswap.
dorothy-zbornak marked this conversation as resolved.
Show resolved Hide resolved
/// @param tokens Sell path.
/// @param sellAmount of `tokens[0]` Amount to sell.
/// @param minBuyAmount Minimum amount of `tokens[-1]` to buy.
/// @param isBakerySwap Use BakerySwap if true.
/// @return buyAmount Amount of `tokens[-1]` bought.
function sellToPancakeSwap(
IERC20TokenV06[] calldata tokens,
uint256 sellAmount,
uint256 minBuyAmount,
bool isBakerySwap
)
external
payable
returns (uint256 buyAmount);
}
56 changes: 0 additions & 56 deletions contracts/zero-ex/contracts/src/features/ITokenSpenderFeature.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ contract LiquidityProviderFeature is
/// @dev The sandbox contract address.
ILiquidityProviderSandbox public immutable sandbox;

constructor(LiquidityProviderSandbox sandbox_, bytes32 greedyTokensBloomFilter)
constructor(LiquidityProviderSandbox sandbox_)
public
FixinCommon()
FixinTokenSpender(greedyTokensBloomFilter)
{
sandbox = sandbox_;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@ contract MetaTransactionsFeature is
}
}

constructor(address zeroExAddress, bytes32 greedyTokensBloomFilter)
constructor(address zeroExAddress)
public
FixinCommon()
FixinEIP712(zeroExAddress)
FixinTokenSpender(greedyTokensBloomFilter)
{
// solhint-disable-next-line no-empty-blocks
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,11 @@ contract NativeOrdersFeature is
IEtherTokenV06 weth,
IStaking staking,
FeeCollectorController feeCollectorController,
uint32 protocolFeeMultiplier,
bytes32 greedyTokensBloomFilter
uint32 protocolFeeMultiplier
)
public
FixinEIP712(zeroExAddress)
FixinProtocolFees(weth, staking, feeCollectorController, protocolFeeMultiplier)
FixinTokenSpender(greedyTokensBloomFilter)
{
// solhint-disable no-empty-blocks
}
Expand Down
Loading