Skip to content

Commit

Permalink
delete remapping for solmate to reduce remapping.txt requirement for …
Browse files Browse the repository at this point in the history
…upstream dependents (#160)
  • Loading branch information
ewilz authored Dec 6, 2022
1 parent 0ded3a9 commit a7cd186
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 33 deletions.
10 changes: 5 additions & 5 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AllowanceTransferInvariants:invariant_balanceEqualsSpent() (runs: 256, calls: 3840, reverts: 884)
AllowanceTransferInvariants:invariant_permit2NeverHoldsBalance() (runs: 256, calls: 3840, reverts: 884)
AllowanceTransferInvariants:invariant_spendNeverExceedsPermit() (runs: 256, calls: 3840, reverts: 884)
AllowanceTransferInvariants:invariant_balanceEqualsSpent() (runs: 256, calls: 3840, reverts: 886)
AllowanceTransferInvariants:invariant_permit2NeverHoldsBalance() (runs: 256, calls: 3840, reverts: 886)
AllowanceTransferInvariants:invariant_spendNeverExceedsPermit() (runs: 256, calls: 3840, reverts: 886)
AllowanceTransferTest:testApprove() (gas: 47561)
AllowanceTransferTest:testBatchTransferFrom() (gas: 159268)
AllowanceTransferTest:testBatchTransferFromDifferentOwners() (gas: 235508)
Expand Down Expand Up @@ -43,7 +43,7 @@ NonceBitmapTest:testInvalidateNonzeroWord() (gas: 85665)
NonceBitmapTest:testInvalidateTwoNoncesRandomly(uint248,uint256,uint256) (runs: 256, μ: 39187, ~: 39187)
NonceBitmapTest:testLowNonces() (gas: 41004)
NonceBitmapTest:testNonceWordBoundary() (gas: 42203)
NonceBitmapTest:testUseTwoRandomNonces(uint256,uint256) (runs: 256, μ: 49120, ~: 51640)
NonceBitmapTest:testUseTwoRandomNonces(uint256,uint256) (runs: 256, μ: 49205, ~: 51640)
NonceBitmapTest:testUsingNonceTwiceFails(uint256) (runs: 256, μ: 21866, ~: 21889)
Permit2LibTest:testOZSafePermit() (gas: 24443)
Permit2LibTest:testOZSafePermitPlusOZSafeTransferFrom() (gas: 129153)
Expand Down Expand Up @@ -102,4 +102,4 @@ TypehashGeneration:testPermitTransferFrom() (gas: 36520)
TypehashGeneration:testPermitTransferFromWithWitness() (gas: 43369)
TypehashGeneration:testPermitTransferFromWithWitnessIncorrectPermitData() (gas: 43430)
TypehashGeneration:testPermitTransferFromWithWitnessIncorrectTypehashStub() (gas: 43833)
MockPermit2Lib:testPermit2Code(address):(bool) (runs: 256, μ: 2911, ~: 2911)
MockPermit2Lib:testPermit2Code(address):(bool) (runs: 256, μ: 35465847065545473, ~: 2911)
4 changes: 1 addition & 3 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
forge-std/=lib/forge-std/src/
openzeppelin-contracts/=lib/openzeppelin-contracts/
solmate/=lib/solmate/src/
solmate/=lib/solmate
4 changes: 2 additions & 2 deletions src/AllowanceTransfer.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
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 {EIP712} from "./EIP712.sol";
Expand Down
4 changes: 2 additions & 2 deletions src/SignatureTransfer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity 0.8.17;

import {ISignatureTransfer} from "./interfaces/ISignatureTransfer.sol";
import {SignatureExpired, InvalidNonce} from "./PermitErrors.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {SafeTransferLib} from "solmate/src/utils/SafeTransferLib.sol";
import {SignatureVerification} from "./libraries/SignatureVerification.sol";
import {PermitHash} from "./libraries/PermitHash.sol";
import {EIP712} from "./EIP712.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Permit2Lib.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

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

import {Permit2} from "../Permit2.sol";
import {IDAIPermit} from "../interfaces/IDAIPermit.sol";
Expand Down
4 changes: 2 additions & 2 deletions test/Permit2Lib.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity ^0.8.17;
import "forge-std/Test.sol";

import {SafeERC20, IERC20, IERC20Permit} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol";
import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol";
import {DSTestPlus} from "solmate/src/test/utils/DSTestPlus.sol";
import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol";
import {Permit2} from "../src/Permit2.sol";
import {Permit2Lib} from "../src/libraries/Permit2Lib.sol";
import {MockNonPermitERC20} from "./mocks/MockNonPermitERC20.sol";
Expand Down
4 changes: 2 additions & 2 deletions test/integration/MainnetToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity ^0.8.17;

import "forge-std/Test.sol";
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
import {SafeTransferLib} from "solmate/src/utils/SafeTransferLib.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {AddressBuilder} from "../utils/AddressBuilder.sol";
import {StructBuilder} from "../utils/StructBuilder.sol";
import {PermitSignature} from "../utils/PermitSignature.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tokens/DAI.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {MainnetTokenTest} from "../MainnetToken.t.sol";

contract DAITest is MainnetTokenTest {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tokens/FeeOnTransferToken.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {MainnetTokenTest} from "../MainnetToken.t.sol";

contract FeeOnTransferTokenTest is MainnetTokenTest {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tokens/RebasingToken.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {MainnetTokenTest} from "../MainnetToken.t.sol";

contract RebasingTokenTest is MainnetTokenTest {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tokens/TooManyReturnBytesToken.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {MainnetTokenTest} from "../MainnetToken.t.sol";

contract TooManyReturnBytesTokenTest is MainnetTokenTest {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tokens/UNI.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {MainnetTokenTest} from "../MainnetToken.t.sol";

contract UNITest is MainnetTokenTest {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tokens/USDC.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {MainnetTokenTest} from "../MainnetToken.t.sol";

contract USDCTest is MainnetTokenTest {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/tokens/USDT.t.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
import {SafeTransferLib} from "solmate/src/utils/SafeTransferLib.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {MainnetTokenTest} from "../MainnetToken.t.sol";

contract USDTTest is MainnetTokenTest {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tokens/WBTC.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {MainnetTokenTest} from "../MainnetToken.t.sol";

contract WBTCTest is MainnetTokenTest {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tokens/ZRX.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {MainnetTokenTest} from "../MainnetToken.t.sol";

contract ZRXTest is MainnetTokenTest {
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/MockERC1155.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC1155} from "solmate/tokens/ERC1155.sol";
import {ERC1155} from "solmate/src/tokens/ERC1155.sol";

contract MockERC1155 is ERC1155 {
constructor() ERC1155() {}
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/MockERC20.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

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

contract MockERC20 is ERC20 {
constructor(string memory name, string memory symbol, uint8 decimals) ERC20(name, symbol, decimals) {}
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/MockERC721.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC721} from "solmate/tokens/ERC721.sol";
import {ERC721} from "solmate/src/tokens/ERC721.sol";

contract MockERC721 is ERC721 {
constructor(string memory name, string memory symbol) ERC721(name, symbol) {}
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/MockNonPermitERC20.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol";
import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol";

contract MockNonPermitERC20 is MockERC20 {
constructor(string memory _name, string memory _symbol, uint8 _decimals) MockERC20(_name, _symbol, _decimals) {}
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/MockPermit2Lib.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC20} from "solmate/src/tokens/ERC20.sol";
import {Permit2Lib} from "../../src/libraries/Permit2Lib.sol";

contract MockPermit2Lib {
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/MockPermitWithDS.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol";
import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol";

contract MockPermitWithSmallDS is MockERC20 {
constructor(string memory _name, string memory _symbol, uint8 _decimals) MockERC20(_name, _symbol, _decimals) {}
Expand Down

0 comments on commit a7cd186

Please sign in to comment.