Skip to content

Commit

Permalink
Add UniswapX as dep and rip out old code (#1)
Browse files Browse the repository at this point in the history
* forge install: UniswapX

v1.1.0

* Rip out old code and use imports

* forge install: UniswapX

main

* Silence warnings

* fix error

* nit: ordering of inputs

* gas specs
  • Loading branch information
zhongeric authored Nov 15, 2023
1 parent 8227d11 commit 8650444
Show file tree
Hide file tree
Showing 72 changed files with 34 additions and 7,370 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
264847
264776
Original file line number Diff line number Diff line change
@@ -1 +1 @@
312312
312241
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@
[submodule "lib/permit2"]
path = lib/permit2
url = https://github.com/Uniswap/permit2
[submodule "lib/UniswapX"]
path = lib/UniswapX
url = https://github.com/Uniswap/UniswapX
branch = main
1 change: 1 addition & 0 deletions lib/UniswapX
Submodule UniswapX added at 4bc3d8
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ solmate/=lib/solmate/
erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/
openzeppelin/=lib/openzeppelin-contracts/contracts/
universal-router/=lib/universal-router/
UniswapX/=lib/UniswapX/
40 changes: 0 additions & 40 deletions script/DeployDutch.s.sol

This file was deleted.

39 changes: 0 additions & 39 deletions script/DeployExclusiveDutch.s.sol

This file was deleted.

27 changes: 0 additions & 27 deletions script/DeploySwapRouter02Executor.s.sol

This file was deleted.

111 changes: 0 additions & 111 deletions src/base/ProtocolFees.sol

This file was deleted.

54 changes: 1 addition & 53 deletions src/base/ReactorStructs.sol
Original file line number Diff line number Diff line change
@@ -1,37 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import {IReactor} from "../interfaces/IReactor.sol";
import {IValidationCallback} from "../interfaces/IValidationCallback.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";

/// @dev generic order information
/// should be included as the first field in any concrete order types
struct OrderInfo {
// The address of the reactor that this order is targeting
// Note that this must be included in every order so the swapper
// signature commits to the specific reactor that they trust to fill their order properly
IReactor reactor;
// The address of the user which created the order
// Note that this must be included so that order hashes are unique by swapper
address swapper;
// The nonce of the order, allowing for signature replay protection and cancellation
uint256 nonce;
// The timestamp after which this order is no longer valid
uint256 deadline;
// Custom validation contract
IValidationCallback additionalValidationContract;
// Encoded validation params for additionalValidationContract
bytes additionalValidationData;
}

/// @dev tokens that need to be sent from the swapper in order to satisfy an order
struct InputToken {
ERC20 token;
uint256 amount;
// Needed for dutch decaying inputs
uint256 maxAmount;
}
import {OrderInfo, OutputToken} from "UniswapX/src/base/ReactorStructs.sol";

/// @dev tokens that need to be sent from the swapper in order to satisfy an order
struct InputTokenWithRecipient {
Expand All @@ -42,13 +13,6 @@ struct InputTokenWithRecipient {
address recipient;
}

/// @dev tokens that need to be received by the recipient in order to satisfy an order
struct OutputToken {
address token;
uint256 amount;
address recipient;
}

struct ResolvedRelayOrder {
OrderInfo info;
bytes[] actions;
Expand All @@ -57,19 +21,3 @@ struct ResolvedRelayOrder {
bytes sig;
bytes32 hash;
}

/// @dev generic concrete order that specifies exact tokens which need to be sent and received
struct ResolvedOrder {
OrderInfo info;
InputToken input;
OutputToken[] outputs;
bytes sig;
bytes32 hash;
}

/// @dev external struct including a generic encoded order and swapper signature
/// The order bytes will be parsed and mapped to a ResolvedOrder in the concrete reactor contract
struct SignedOrder {
bytes order;
bytes sig;
}
31 changes: 0 additions & 31 deletions src/external/ISwapRouter02.sol

This file was deleted.

12 changes: 0 additions & 12 deletions src/interfaces/IProtocolFeeController.sol

This file was deleted.

25 changes: 0 additions & 25 deletions src/interfaces/IReactor.sol

This file was deleted.

Loading

0 comments on commit 8650444

Please sign in to comment.