From 5cd3a7cc6649402e9a2fdaad9e5cfe53cedb0a48 Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Fri, 13 Jan 2023 15:11:33 -0700 Subject: [PATCH] import matching --- src/ERC20/AllowanceTransfer.sol | 4 ++-- src/ERC20/SignatureTransfer.sol | 4 ++-- src/{ERC20/interfaces => shared}/IERC1271.sol | 0 src/{ERC20 => shared}/PermitErrors.sol | 0 src/{ERC20/libraries => shared}/SignatureVerification.sol | 2 +- test/AllowanceTransferInvariants.t.sol | 2 +- test/AllowanceTransferTest.t.sol | 4 ++-- test/NonceBitmap.t.sol | 2 +- test/Permit2Lib.t.sol | 2 +- test/SignatureTransfer.t.sol | 6 +++--- test/TypehashGeneration.t.sol | 2 +- test/integration/Argent.t.sol | 2 +- test/integration/GnosisSafe.t.sol | 2 +- test/mocks/MockSignatureVerification.sol | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) rename src/{ERC20/interfaces => shared}/IERC1271.sol (100%) rename src/{ERC20 => shared}/PermitErrors.sol (100%) rename src/{ERC20/libraries => shared}/SignatureVerification.sol (97%) diff --git a/src/ERC20/AllowanceTransfer.sol b/src/ERC20/AllowanceTransfer.sol index 56c4cce0..c1339957 100644 --- a/src/ERC20/AllowanceTransfer.sol +++ b/src/ERC20/AllowanceTransfer.sol @@ -4,10 +4,10 @@ pragma solidity 0.8.17; import {ERC20} from "solmate/src/tokens/ERC20.sol"; import {SafeTransferLib} from "solmate/src/utils/SafeTransferLib.sol"; import {PermitHash} from "./libraries/PermitHash.sol"; -import {SignatureVerification} from "./libraries/SignatureVerification.sol"; +import {SignatureVerification} from "../shared/SignatureVerification.sol"; import {EIP712} from "./EIP712.sol"; import {IAllowanceTransfer} from "./interfaces/IAllowanceTransfer.sol"; -import {SignatureExpired, InvalidNonce} from "./PermitErrors.sol"; +import {SignatureExpired, InvalidNonce} from "../shared/PermitErrors.sol"; import {Allowance} from "./libraries/Allowance.sol"; contract AllowanceTransfer is IAllowanceTransfer, EIP712 { diff --git a/src/ERC20/SignatureTransfer.sol b/src/ERC20/SignatureTransfer.sol index c026553a..14d69e86 100644 --- a/src/ERC20/SignatureTransfer.sol +++ b/src/ERC20/SignatureTransfer.sol @@ -2,10 +2,10 @@ pragma solidity 0.8.17; import {ISignatureTransfer} from "./interfaces/ISignatureTransfer.sol"; -import {SignatureExpired, InvalidNonce} from "./PermitErrors.sol"; +import {SignatureExpired, InvalidNonce} from "../shared/PermitErrors.sol"; import {ERC20} from "solmate/src/tokens/ERC20.sol"; import {SafeTransferLib} from "solmate/src/utils/SafeTransferLib.sol"; -import {SignatureVerification} from "./libraries/SignatureVerification.sol"; +import {SignatureVerification} from "../shared/SignatureVerification.sol"; import {PermitHash} from "./libraries/PermitHash.sol"; import {EIP712} from "./EIP712.sol"; diff --git a/src/ERC20/interfaces/IERC1271.sol b/src/shared/IERC1271.sol similarity index 100% rename from src/ERC20/interfaces/IERC1271.sol rename to src/shared/IERC1271.sol diff --git a/src/ERC20/PermitErrors.sol b/src/shared/PermitErrors.sol similarity index 100% rename from src/ERC20/PermitErrors.sol rename to src/shared/PermitErrors.sol diff --git a/src/ERC20/libraries/SignatureVerification.sol b/src/shared/SignatureVerification.sol similarity index 97% rename from src/ERC20/libraries/SignatureVerification.sol rename to src/shared/SignatureVerification.sol index 904dfcd2..12d0b542 100644 --- a/src/ERC20/libraries/SignatureVerification.sol +++ b/src/shared/SignatureVerification.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.17; -import {IERC1271} from "../interfaces/IERC1271.sol"; +import {IERC1271} from "./IERC1271.sol"; library SignatureVerification { /// @notice Thrown when the passed in signature is not a valid length diff --git a/test/AllowanceTransferInvariants.t.sol b/test/AllowanceTransferInvariants.t.sol index dd6d111e..80224bb8 100644 --- a/test/AllowanceTransferInvariants.t.sol +++ b/test/AllowanceTransferInvariants.t.sol @@ -4,7 +4,7 @@ import "forge-std/Test.sol"; import {TokenProvider} from "./utils/TokenProvider.sol"; import {Permit2} from "../src/ERC20/Permit2.sol"; import {IAllowanceTransfer} from "../src/ERC20/interfaces/IAllowanceTransfer.sol"; -import {SignatureVerification} from "../src/ERC20/libraries/SignatureVerification.sol"; +import {SignatureVerification} from "../src/shared/SignatureVerification.sol"; import {PermitSignature} from "./utils/PermitSignature.sol"; import {InvariantTest} from "./utils/InvariantTest.sol"; import {MockERC20} from "./mocks/MockERC20.sol"; diff --git a/test/AllowanceTransferTest.t.sol b/test/AllowanceTransferTest.t.sol index df827197..aa79a2a0 100644 --- a/test/AllowanceTransferTest.t.sol +++ b/test/AllowanceTransferTest.t.sol @@ -5,12 +5,12 @@ import "forge-std/Test.sol"; import {TokenProvider} from "./utils/TokenProvider.sol"; import {Permit2} from "../src/ERC20/Permit2.sol"; import {PermitSignature} from "./utils/PermitSignature.sol"; -import {SignatureVerification} from "../src/ERC20/libraries/SignatureVerification.sol"; +import {SignatureVerification} from "../src/shared/SignatureVerification.sol"; import {AddressBuilder} from "./utils/AddressBuilder.sol"; import {StructBuilder} from "./utils/StructBuilder.sol"; import {AmountBuilder} from "./utils/AmountBuilder.sol"; import {AllowanceTransfer} from "../src/ERC20/AllowanceTransfer.sol"; -import {SignatureExpired, InvalidNonce} from "../src/ERC20/PermitErrors.sol"; +import {SignatureExpired, InvalidNonce} from "../src/shared/PermitErrors.sol"; import {IAllowanceTransfer} from "../src/ERC20/interfaces/IAllowanceTransfer.sol"; import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; diff --git a/test/NonceBitmap.t.sol b/test/NonceBitmap.t.sol index 2f37f7f7..6984e9f6 100644 --- a/test/NonceBitmap.t.sol +++ b/test/NonceBitmap.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.17; import "forge-std/Test.sol"; import {SafeERC20, IERC20, IERC20Permit} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; import {MockPermit2} from "./mocks/MockPermit2.sol"; -import {InvalidNonce} from "../src/ERC20/PermitErrors.sol"; +import {InvalidNonce} from "../src/shared/PermitErrors.sol"; contract NonceBitmapTest is Test { MockPermit2 permit2; diff --git a/test/Permit2Lib.t.sol b/test/Permit2Lib.t.sol index a74143ce..48cb6173 100644 --- a/test/Permit2Lib.t.sol +++ b/test/Permit2Lib.t.sol @@ -16,7 +16,7 @@ import {MockPermit2Lib} from "./mocks/MockPermit2Lib.sol"; import {SafeCast160} from "../src/ERC20/libraries/SafeCast160.sol"; import {MockPermitWithSmallDS, MockPermitWithLargerDS} from "./mocks/MockPermitWithDS.sol"; import {MockNonPermitNonERC20WithDS} from "./mocks/MockNonPermitNonERC20WithDS.sol"; -import {SignatureVerification} from "../src/ERC20/libraries/SignatureVerification.sol"; +import {SignatureVerification} from "../src/shared/SignatureVerification.sol"; import {MockFallbackERC20} from "./mocks/MockFallbackERC20.sol"; contract Permit2LibTest is Test, PermitSignature, GasSnapshot { diff --git a/test/SignatureTransfer.t.sol b/test/SignatureTransfer.t.sol index 8952a1c2..55e6bd53 100644 --- a/test/SignatureTransfer.t.sol +++ b/test/SignatureTransfer.t.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.17; import "forge-std/Test.sol"; import {SafeERC20, IERC20, IERC20Permit} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; -import {SignatureVerification} from "../src/ERC20/libraries/SignatureVerification.sol"; +import {SignatureVerification} from "../src/shared/SignatureVerification.sol"; import {TokenProvider} from "./utils/TokenProvider.sol"; -import {SignatureVerification} from "../src/ERC20/libraries/SignatureVerification.sol"; +import {SignatureVerification} from "../src/shared/SignatureVerification.sol"; import {PermitSignature} from "./utils/PermitSignature.sol"; import {AddressBuilder} from "./utils/AddressBuilder.sol"; import {AmountBuilder} from "./utils/AmountBuilder.sol"; @@ -14,7 +14,7 @@ import {Permit2} from "../src/ERC20/Permit2.sol"; import {SignatureTransfer} from "../src/ERC20/SignatureTransfer.sol"; import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {ISignatureTransfer} from "../src/ERC20/interfaces/ISignatureTransfer.sol"; -import {InvalidNonce, SignatureExpired} from "../src/ERC20/PermitErrors.sol"; +import {InvalidNonce, SignatureExpired} from "../src/shared/PermitErrors.sol"; contract SignatureTransferTest is Test, PermitSignature, TokenProvider, GasSnapshot { using AddressBuilder for address[]; diff --git a/test/TypehashGeneration.t.sol b/test/TypehashGeneration.t.sol index 724f7345..a02b049b 100644 --- a/test/TypehashGeneration.t.sol +++ b/test/TypehashGeneration.t.sol @@ -9,7 +9,7 @@ import {ISignatureTransfer} from "../src/ERC20/interfaces/ISignatureTransfer.sol import {MockSignatureVerification} from "./mocks/MockSignatureVerification.sol"; import {MockHash} from "./mocks/MockHash.sol"; import {AddressBuilder} from "./utils/AddressBuilder.sol"; -import {SignatureVerification} from "../src/ERC20/libraries/SignatureVerification.sol"; +import {SignatureVerification} from "../src/shared/SignatureVerification.sol"; contract TypehashGeneration is Test, PermitSignature { using PermitHash for *; diff --git a/test/integration/Argent.t.sol b/test/integration/Argent.t.sol index 49890196..77e38d69 100644 --- a/test/integration/Argent.t.sol +++ b/test/integration/Argent.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.17; import "forge-std/Test.sol"; -import {IERC1271} from "../../src/ERC20/interfaces/IERC1271.sol"; +import {IERC1271} from "../../src/shared/IERC1271.sol"; interface WalletFactory { function owner() external returns (address); diff --git a/test/integration/GnosisSafe.t.sol b/test/integration/GnosisSafe.t.sol index 4075bbfb..636b9cea 100644 --- a/test/integration/GnosisSafe.t.sol +++ b/test/integration/GnosisSafe.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.17; import "forge-std/Test.sol"; -import {IERC1271} from "../../src/ERC20/interfaces/IERC1271.sol"; +import {IERC1271} from "../../src/shared/IERC1271.sol"; interface GnosisSafeProxy is IERC1271 { function setup( diff --git a/test/mocks/MockSignatureVerification.sol b/test/mocks/MockSignatureVerification.sol index 718eff5f..a27c75ad 100644 --- a/test/mocks/MockSignatureVerification.sol +++ b/test/mocks/MockSignatureVerification.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.17; -import {SignatureVerification} from "../../src/ERC20/libraries/SignatureVerification.sol"; +import {SignatureVerification} from "../../src/shared/SignatureVerification.sol"; contract MockSignatureVerification { function verify(bytes calldata sig, bytes32 hashed, address signer) public view {