Skip to content

add permit2 as submodule, organize files to folders #65

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

Merged
merged 4 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/permit2"]
path = lib/permit2
url = https://github.com/Uniswap/permit2
1 change: 1 addition & 0 deletions lib/permit2
Submodule permit2 added at cc56ad
4 changes: 2 additions & 2 deletions src/Orders.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

import {UsesPermit2, Permit2Batch} from "./permit2/UsesPermit2.sol";
import {IOrders} from "./interfaces/IOrders.sol";
import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {Permit2Batch, UsesPermit2} from "./UsesPermit2.sol";
import {IOrders} from "./IOrders.sol";

/// @notice Contract capable of processing fulfillment of intent-based Orders.
abstract contract OrderDestination is IOrders, UsesPermit2 {
Expand Down
2 changes: 1 addition & 1 deletion src/Passage.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

import {UsesPermit2, Permit2} from "./permit2/UsesPermit2.sol";
import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {ERC20Burnable} from "openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import {UsesPermit2, Permit2} from "./UsesPermit2.sol";

/// @notice A contract deployed to Host chain that allows tokens to enter the rollup.
contract Passage is UsesPermit2 {
Expand Down
2 changes: 0 additions & 2 deletions src/Zenith.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

import {Passage} from "./Passage.sol";

contract Zenith {
/// @notice The address that is allowed to set/remove sequencers.
address public immutable sequencerAdmin;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/UsesPermit2.sol → src/permit2/UsesPermit2.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

import {ISignatureTransfer} from "./vendored/ISignatureTransfer.sol";
import {IOrders} from "./IOrders.sol";
import {ISignatureTransfer} from "permit2/src/interfaces/ISignatureTransfer.sol";
import {IOrders} from "../interfaces/IOrders.sol";

/// @param permit - the permit2 batch token transfer details. includes a `deadline` and an unordered `nonce`.
/// @param signer - the signer of the permit2 info; the owner of the tokens.
Expand Down
6 changes: 0 additions & 6 deletions src/vendored/IEIP712.sol

This file was deleted.

134 changes: 0 additions & 134 deletions src/vendored/ISignatureTransfer.sol

This file was deleted.

3 changes: 1 addition & 2 deletions test/Orders.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ pragma solidity ^0.8.24;
import {Test, console2} from "forge-std/Test.sol";
import {TestERC20} from "./Helpers.t.sol";
import {ERC20} from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";

import {RollupOrders, OrderOrigin} from "../src/Orders.sol";
import {IOrders} from "../src/IOrders.sol";
import {IOrders} from "../src/interfaces/IOrders.sol";

contract OrdersTest is Test {
RollupOrders public target;
Expand Down