Skip to content

Commit

Permalink
Remove forge-std dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Apr 8, 2024
1 parent 878db87 commit ed1c3c3
Show file tree
Hide file tree
Showing 8 changed files with 2,823 additions and 69 deletions.
62 changes: 31 additions & 31 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
MulticallerTest:testMultiCallerWithSignerIncrementNonceSalt(uint256) (runs: 256, μ: 83584, ~: 83538)
MulticallerTest:testMultiCallerWithSignerIncrementNonceSaltWithERC1271(uint256) (runs: 256, μ: 614876, ~: 614922)
MulticallerTest:testMulticallerCdFallback(string) (runs: 256, μ: 295907, ~: 281868)
MulticallerTest:testMulticallerForwardsMessageValue() (gas: 214013)
MulticallerTest:testMulticallerGetNames() (gas: 147637)
MulticallerTest:testMulticallerReentrancyGuard() (gas: 19980)
MulticallerTest:testMulticallerRefund(uint256) (runs: 256, μ: 169488, ~: 171890)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded() (gas: 122173)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 486042, ~: 450256)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 122252, ~: 122252)
MulticallerTest:testMulticallerRevertWithCustomError() (gas: 35485)
MulticallerTest:testMulticallerRevertWithMessage() (gas: 38244)
MulticallerTest:testMulticallerRevertWithMessage(string) (runs: 256, μ: 38922, ~: 38644)
MulticallerTest:testMulticallerRevertWithNothing() (gas: 35306)
MulticallerTest:testMulticallerSenderDoesNotRevertWithoutMulticallerDeployed() (gas: 3463)
MulticallerTest:testMulticallerTargetGetMulticallerSender() (gas: 27523)
MulticallerTest:testMulticallerWithNoData() (gas: 16213)
MulticallerTest:testMulticallerWithSigner(uint256) (runs: 256, μ: 128165, ~: 119136)
MulticallerTest:testMulticallerWithSignerEIP712Domain() (gas: 12375)
MulticallerTest:testMulticallerWithSignerGetMulticallerSigner() (gas: 136504)
MulticallerTest:testMulticallerWithSignerInvalidateNonces(uint256) (runs: 256, μ: 79177, ~: 77798)
MulticallerTest:testMulticallerWithSignerInvalidateNoncesWithERC1271(uint256) (runs: 256, μ: 617027, ~: 616455)
MulticallerTest:testMulticallerWithSignerNonPayableFunctions() (gas: 48884)
MulticallerTest:testMulticallerWithSignerReentrancyGuard() (gas: 124909)
MulticallerTest:testMulticallerWithSignerRevert() (gas: 206240)
MulticallerTest:testMulticallerWithSignerWithERC1271(uint256) (runs: 256, μ: 661769, ~: 651359)
MulticallerTest:testMulticallerWithSignerWithNoData() (gas: 130147)
MulticallerTest:testNastyCalldataRevert() (gas: 3420)
MulticallerTest:testOffsetTrick(uint256,uint256,uint256) (runs: 256, μ: 571, ~: 571)
MulticallerTest:test__codesize() (gas: 50297)
TestPlus:test__codesize() (gas: 1102)
MulticallerTest:testMultiCallerWithSignerIncrementNonceSalt(uint256) (runs: 256, μ: 83552, ~: 83533)
MulticallerTest:testMultiCallerWithSignerIncrementNonceSaltWithERC1271(uint256) (runs: 256, μ: 614905, ~: 614953)
MulticallerTest:testMulticallerCdFallback(string) (runs: 256, μ: 187169, ~: 181861)
MulticallerTest:testMulticallerForwardsMessageValue() (gas: 214101)
MulticallerTest:testMulticallerGetNames() (gas: 46531)
MulticallerTest:testMulticallerReentrancyGuard() (gas: 20005)
MulticallerTest:testMulticallerRefund(uint256) (runs: 256, μ: 169652, ~: 171909)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded() (gas: 38730)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 224746, ~: 212808)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 38832, ~: 38832)
MulticallerTest:testMulticallerRevertWithCustomError() (gas: 35431)
MulticallerTest:testMulticallerRevertWithMessage() (gas: 38277)
MulticallerTest:testMulticallerRevertWithMessage(string) (runs: 256, μ: 38933, ~: 38655)
MulticallerTest:testMulticallerRevertWithNothing() (gas: 35278)
MulticallerTest:testMulticallerSenderDoesNotRevertWithoutMulticallerDeployed() (gas: 3485)
MulticallerTest:testMulticallerTargetGetMulticallerSender() (gas: 27557)
MulticallerTest:testMulticallerWithNoData() (gas: 16170)
MulticallerTest:testMulticallerWithSigner(uint256) (runs: 256, μ: 128140, ~: 119223)
MulticallerTest:testMulticallerWithSignerEIP712Domain() (gas: 11361)
MulticallerTest:testMulticallerWithSignerGetMulticallerSigner() (gas: 136483)
MulticallerTest:testMulticallerWithSignerInvalidateNonces(uint256) (runs: 256, μ: 80929, ~: 79415)
MulticallerTest:testMulticallerWithSignerInvalidateNoncesWithERC1271(uint256) (runs: 256, μ: 617130, ~: 616495)
MulticallerTest:testMulticallerWithSignerNonPayableFunctions() (gas: 48848)
MulticallerTest:testMulticallerWithSignerReentrancyGuard() (gas: 124834)
MulticallerTest:testMulticallerWithSignerRevert() (gas: 206198)
MulticallerTest:testMulticallerWithSignerWithERC1271(uint256) (runs: 256, μ: 661007, ~: 651334)
MulticallerTest:testMulticallerWithSignerWithNoData() (gas: 130081)
MulticallerTest:testNastyCalldataRevert() (gas: 3552)
MulticallerTest:testOffsetTrick(uint256,uint256,uint256) (runs: 256, μ: 527, ~: 527)
MulticallerTest:test__codesize() (gas: 48435)
TestPlus:test__codesize() (gas: 840)
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
33 changes: 1 addition & 32 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,11 @@ optimizer = true
optimizer_runs = 1_000
gas_limit = 100_000_000 # ETH is 30M, but we use a higher value.
remappings = [
"forge-std=lib/forge-std/src/",
"openzeppelin-contracts-upgradeable=lib/openzeppelin-contracts-upgradeable/contracts/",
"openzeppelin-contracts=lib/openzeppelin-contracts/contracts/",
"erc721a=lib/erc721a/contracts/",
"erc721a-upgradeable=lib/erc721a-upgradeable/contracts/",
"operator-filter-registry=lib/operator-filter-registry/src/"
"forge-std=test/utils/forge-std/"
]

[fmt]
line_length = 100 # While we allow up to 120, we lint at 100 for readability.

[profile.default.fuzz]
runs = 256

[profile.intense-0.fuzz]
runs = 5_000

[profile.intense-1.fuzz]
seed = 0x12345678
runs = 5_000

[profile.via-ir]
via_ir = true

[profile.via-ir.fuzz]
runs = 1_000

[profile.min-solc]
solc_version = '0.8.13'

[profile.min-solc.fuzz]
runs = 1_000

[profile.min-solc-via-ir]
via_ir = true
solc_version = '0.8.13'

[profile.min-solc-via-ir.fuzz]
runs = 1_000
1 change: 0 additions & 1 deletion lib/forge-std
Submodule forge-std deleted from 2c7cbf
5 changes: 3 additions & 2 deletions test/Multicaller.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ contract MulticallerTest is TestPlus {
}
}

function _generateSignature(_TestTemps memory t) internal {
function _generateSignature(_TestTemps memory t) internal view {
unchecked {
bytes32[] memory dataHashes = new bytes32[](t.data.length);
for (uint256 i; i < t.data.length; ++i) {
Expand Down Expand Up @@ -929,7 +929,7 @@ contract MulticallerTest is TestPlus {
uint256[] memory nonces,
address signer,
uint256 privateKey
) internal returns (bytes memory signature) {
) internal view returns (bytes memory signature) {
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
Expand All @@ -952,6 +952,7 @@ contract MulticallerTest is TestPlus {

function _generateIncrementNonceSaltSignature(address signer, uint256 privateKey)
internal
view
returns (bytes memory signature)
{
bytes32 digest = keccak256(
Expand Down
11 changes: 11 additions & 0 deletions test/utils/forge-std/Script.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;

import "./Vm.sol";

abstract contract Script {
bool public IS_SCRIPT = true;

/// @dev `address(bytes20(uint160(uint256(keccak256("hevm cheat code")))))`.
Vm public constant vm = Vm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
}
Loading

0 comments on commit ed1c3c3

Please sign in to comment.