Skip to content

Commit 6593fa2

Browse files
authored
👷‍♂️ Update CI (#36)
* Remove forge-std dependency * Update workflows * T * T * T
1 parent 878db87 commit 6593fa2

File tree

11 files changed

+2950
-97
lines changed

11 files changed

+2950
-97
lines changed

.gas-snapshot

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
MulticallerTest:testMultiCallerWithSignerIncrementNonceSalt(uint256) (runs: 256, μ: 83584, ~: 83538)
2-
MulticallerTest:testMultiCallerWithSignerIncrementNonceSaltWithERC1271(uint256) (runs: 256, μ: 614876, ~: 614922)
3-
MulticallerTest:testMulticallerCdFallback(string) (runs: 256, μ: 295907, ~: 281868)
4-
MulticallerTest:testMulticallerForwardsMessageValue() (gas: 214013)
5-
MulticallerTest:testMulticallerGetNames() (gas: 147637)
6-
MulticallerTest:testMulticallerReentrancyGuard() (gas: 19980)
7-
MulticallerTest:testMulticallerRefund(uint256) (runs: 256, μ: 169488, ~: 171890)
8-
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded() (gas: 122173)
9-
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 486042, ~: 450256)
10-
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 122252, ~: 122252)
11-
MulticallerTest:testMulticallerRevertWithCustomError() (gas: 35485)
12-
MulticallerTest:testMulticallerRevertWithMessage() (gas: 38244)
13-
MulticallerTest:testMulticallerRevertWithMessage(string) (runs: 256, μ: 38922, ~: 38644)
14-
MulticallerTest:testMulticallerRevertWithNothing() (gas: 35306)
15-
MulticallerTest:testMulticallerSenderDoesNotRevertWithoutMulticallerDeployed() (gas: 3463)
16-
MulticallerTest:testMulticallerTargetGetMulticallerSender() (gas: 27523)
17-
MulticallerTest:testMulticallerWithNoData() (gas: 16213)
18-
MulticallerTest:testMulticallerWithSigner(uint256) (runs: 256, μ: 128165, ~: 119136)
19-
MulticallerTest:testMulticallerWithSignerEIP712Domain() (gas: 12375)
20-
MulticallerTest:testMulticallerWithSignerGetMulticallerSigner() (gas: 136504)
21-
MulticallerTest:testMulticallerWithSignerInvalidateNonces(uint256) (runs: 256, μ: 79177, ~: 77798)
22-
MulticallerTest:testMulticallerWithSignerInvalidateNoncesWithERC1271(uint256) (runs: 256, μ: 617027, ~: 616455)
23-
MulticallerTest:testMulticallerWithSignerNonPayableFunctions() (gas: 48884)
24-
MulticallerTest:testMulticallerWithSignerReentrancyGuard() (gas: 124909)
25-
MulticallerTest:testMulticallerWithSignerRevert() (gas: 206240)
26-
MulticallerTest:testMulticallerWithSignerWithERC1271(uint256) (runs: 256, μ: 661769, ~: 651359)
27-
MulticallerTest:testMulticallerWithSignerWithNoData() (gas: 130147)
28-
MulticallerTest:testNastyCalldataRevert() (gas: 3420)
29-
MulticallerTest:testOffsetTrick(uint256,uint256,uint256) (runs: 256, μ: 571, ~: 571)
30-
MulticallerTest:test__codesize() (gas: 50297)
31-
TestPlus:test__codesize() (gas: 1102)
1+
MulticallerTest:testMultiCallerWithSignerIncrementNonceSalt(uint256) (runs: 256, μ: 83552, ~: 83533)
2+
MulticallerTest:testMultiCallerWithSignerIncrementNonceSaltWithERC1271(uint256) (runs: 256, μ: 614905, ~: 614953)
3+
MulticallerTest:testMulticallerCdFallback(string) (runs: 256, μ: 187169, ~: 181861)
4+
MulticallerTest:testMulticallerForwardsMessageValue() (gas: 214101)
5+
MulticallerTest:testMulticallerGetNames() (gas: 46531)
6+
MulticallerTest:testMulticallerReentrancyGuard() (gas: 20005)
7+
MulticallerTest:testMulticallerRefund(uint256) (runs: 256, μ: 169652, ~: 171909)
8+
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded() (gas: 38730)
9+
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 224746, ~: 212808)
10+
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 38832, ~: 38832)
11+
MulticallerTest:testMulticallerRevertWithCustomError() (gas: 35431)
12+
MulticallerTest:testMulticallerRevertWithMessage() (gas: 38277)
13+
MulticallerTest:testMulticallerRevertWithMessage(string) (runs: 256, μ: 38933, ~: 38655)
14+
MulticallerTest:testMulticallerRevertWithNothing() (gas: 35278)
15+
MulticallerTest:testMulticallerSenderDoesNotRevertWithoutMulticallerDeployed() (gas: 3485)
16+
MulticallerTest:testMulticallerTargetGetMulticallerSender() (gas: 27557)
17+
MulticallerTest:testMulticallerWithNoData() (gas: 16170)
18+
MulticallerTest:testMulticallerWithSigner(uint256) (runs: 256, μ: 128140, ~: 119223)
19+
MulticallerTest:testMulticallerWithSignerEIP712Domain() (gas: 11361)
20+
MulticallerTest:testMulticallerWithSignerGetMulticallerSigner() (gas: 136483)
21+
MulticallerTest:testMulticallerWithSignerInvalidateNonces(uint256) (runs: 256, μ: 80929, ~: 79415)
22+
MulticallerTest:testMulticallerWithSignerInvalidateNoncesWithERC1271(uint256) (runs: 256, μ: 617130, ~: 616495)
23+
MulticallerTest:testMulticallerWithSignerNonPayableFunctions() (gas: 48848)
24+
MulticallerTest:testMulticallerWithSignerReentrancyGuard() (gas: 124834)
25+
MulticallerTest:testMulticallerWithSignerRevert() (gas: 206198)
26+
MulticallerTest:testMulticallerWithSignerWithERC1271(uint256) (runs: 256, μ: 661007, ~: 651334)
27+
MulticallerTest:testMulticallerWithSignerWithNoData() (gas: 130081)
28+
MulticallerTest:testNastyCalldataRevert() (gas: 3552)
29+
MulticallerTest:testOffsetTrick(uint256,uint256,uint256) (runs: 256, μ: 527, ~: 527)
30+
MulticallerTest:test__codesize() (gas: 48435)
31+
TestPlus:test__codesize() (gas: 840)

.github/workflows/ci-all-via-ir.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: ci-all-via-ir
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
tests:
8+
name: Forge Testing all via-ir
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
profile: [via-ir-0,via-ir-1]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install Foundry
19+
uses: foundry-rs/foundry-toolchain@v1
20+
with:
21+
version: nightly
22+
23+
- name: Install Dependencies
24+
run: forge install
25+
26+
- name: Run Tests with ${{ matrix.profile }}
27+
run: >
28+
( [ "${{ matrix.profile }}" = "via-ir-0" ] &&
29+
forge test --use 0.8.14 --via-ir &&
30+
forge test --use 0.8.15 --via-ir &&
31+
forge test --use 0.8.16 --via-ir &&
32+
forge test --use 0.8.17 --via-ir &&
33+
forge test --use 0.8.13 --via-ir &&
34+
forge test --use 0.8.12 --via-ir &&
35+
forge test --use 0.8.11 --via-ir &&
36+
forge test --use 0.8.10 --via-ir
37+
) ||
38+
( [ "${{ matrix.profile }}" = "via-ir-1" ] &&
39+
forge test --use 0.8.25 --via-ir &&
40+
forge test --use 0.8.24 --via-ir &&
41+
forge test --use 0.8.23 --via-ir &&
42+
forge test --use 0.8.22 --via-ir &&
43+
forge test --use 0.8.21 --via-ir &&
44+
forge test --use 0.8.20 --via-ir &&
45+
forge test --use 0.8.19 --via-ir &&
46+
forge test --use 0.8.18 --via-ir
47+
)

.github/workflows/ci.yml

Lines changed: 76 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,96 @@
11
name: ci
22

3-
on: [push]
4-
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- '**.sol'
8+
- '**.yml'
9+
push:
10+
branches: [main]
11+
paths:
12+
- '**.sol'
13+
- '**.yml'
514
jobs:
615
tests:
716
name: Forge Testing
817
runs-on: ubuntu-latest
9-
18+
1019
strategy:
1120
matrix:
12-
profile: [via-ir,min-solc,min-solc-via-ir,intense,solc-past-versions-0,solc-past-versions-1]
21+
profile: [post-cancun,post-cancun-via-ir,solc-past-versions-0,solc-past-versions-1,via-ir,min-solc,min-solc-via-ir,intense]
1322

1423
steps:
15-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
1625

1726
- name: Install Foundry
18-
uses: onbjerg/foundry-toolchain@v1
27+
uses: foundry-rs/foundry-toolchain@v1
1928
with:
2029
version: nightly
2130

2231
- name: Install Dependencies
2332
run: forge install
2433

25-
- name: Run Lint Check
26-
run: forge fmt --check
27-
2834
- name: Run Tests with ${{ matrix.profile }}
2935
run: >
30-
( [ "${{ matrix.profile }}" = "solc-past-versions-0" ] &&
31-
forge test --use 0.8.5 &&
32-
forge test --use 0.8.6 &&
33-
forge test --use 0.8.7 &&
34-
forge test --use 0.8.8 &&
35-
forge test --use 0.8.9 &&
36-
forge test --use 0.8.10 &&
37-
forge test --use 0.8.11
38-
) ||
39-
( [ "${{ matrix.profile }}" = "solc-past-versions-1" ] &&
40-
forge test --use 0.8.12 &&
41-
forge test --use 0.8.13 &&
42-
forge test --use 0.8.14 &&
43-
forge test --use 0.8.15 &&
44-
forge test --use 0.8.16 &&
45-
forge test --use 0.8.17 &&
46-
forge test --use 0.8.18
47-
) ||
48-
FOUNDRY_PROFILE=${{ matrix.profile }} forge test
36+
( [ "${{ matrix.profile }}" = "post-cancun" ] &&
37+
forge test --use 0.8.25 --evm-version "cancun"
38+
) ||
39+
( [ "${{ matrix.profile }}" = "post-cancun-via-ir" ] &&
40+
forge test --use 0.8.25 --evm-version "cancun" --via-ir
41+
) ||
42+
( [ "${{ matrix.profile }}" = "solc-past-versions-0" ] &&
43+
forge test --use 0.8.5 --fuzz-runs 16 &&
44+
forge test --use 0.8.6 --fuzz-runs 16 &&
45+
forge test --use 0.8.7 --fuzz-runs 16 &&
46+
forge test --use 0.8.8 --fuzz-runs 16 &&
47+
forge test --use 0.8.9 --fuzz-runs 16 &&
48+
forge test --use 0.8.10 --fuzz-runs 16 &&
49+
forge test --use 0.8.11 --fuzz-runs 16 &&
50+
forge test --use 0.8.12 --fuzz-runs 16
51+
) ||
52+
( [ "${{ matrix.profile }}" = "solc-past-versions-1" ] &&
53+
forge test --use 0.8.13 --fuzz-runs 16 &&
54+
forge test --use 0.8.14 --fuzz-runs 16 &&
55+
forge test --use 0.8.15 --fuzz-runs 16 &&
56+
forge test --use 0.8.16 --fuzz-runs 16 &&
57+
forge test --use 0.8.17 --fuzz-runs 16 &&
58+
forge test --use 0.8.18 --fuzz-runs 16 &&
59+
forge test --use 0.8.19 --fuzz-runs 16 &&
60+
forge test --use 0.8.20 --fuzz-runs 16 &&
61+
forge test --use 0.8.21 --fuzz-runs 16 &&
62+
forge test --use 0.8.22 --fuzz-runs 16 &&
63+
forge test --use 0.8.23 --fuzz-runs 16 &&
64+
forge test --use 0.8.24 --fuzz-runs 16
65+
) ||
66+
( [ "${{ matrix.profile }}" = "via-ir" ] &&
67+
forge test --via-ir
68+
) ||
69+
( [ "${{ matrix.profile }}" = "min-solc" ] &&
70+
forge fmt --check &&
71+
forge test --use 0.8.4
72+
) ||
73+
( [ "${{ matrix.profile }}" = "min-solc-via-ir" ] &&
74+
forge test --use 0.8.13 --via-ir
75+
) ||
76+
( [ "${{ matrix.profile }}" = "intense" ] &&
77+
forge test --fuzz-runs 5000
78+
)
79+
80+
codespell:
81+
runs-on: ${{ matrix.os }}
82+
strategy:
83+
matrix:
84+
os:
85+
- ubuntu-latest
86+
87+
steps:
88+
- name: Checkout
89+
uses: actions/checkout@v4
90+
91+
- name: Run codespell
92+
uses: codespell-project/[email protected]
93+
with:
94+
check_filenames: true
95+
ignore_words_list: usera
96+
skip: ./.git,package-lock.json,ackee-blockchain-solady-report.pdf,EIP712Mock.sol

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "lib/forge-std"]
2-
path = lib/forge-std
3-
url = https://github.com/foundry-rs/forge-std

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![NPM][npm-shield]][npm-url]
44
[![CI][ci-shield]][ci-url]
5+
[![Solidity][solidity-shield]][solidity-ci-url]
56

67
Efficiently call multiple contracts in a single transaction.
78

@@ -100,3 +101,6 @@ We would like to thank our [reviewers and contributors](credits.txt) for their i
100101

101102
[ci-shield]: https://img.shields.io/github/actions/workflow/status/vectorized/multicaller/ci.yml?label=build&branch=main
102103
[ci-url]: https://github.com/vectorized/multicaller/actions/workflows/ci.yml
104+
105+
[solidity-shield]: https://img.shields.io/badge/solidity-%3E=0.8.10%20%3C=0.8.25-aa6746
106+
[solidity-ci-url]: https://github.com/Vectorized/solady/actions/workflows/ci-all-via-ir.yml

foundry.toml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,11 @@ optimizer = true
1010
optimizer_runs = 1_000
1111
gas_limit = 100_000_000 # ETH is 30M, but we use a higher value.
1212
remappings = [
13-
"forge-std=lib/forge-std/src/",
14-
"openzeppelin-contracts-upgradeable=lib/openzeppelin-contracts-upgradeable/contracts/",
15-
"openzeppelin-contracts=lib/openzeppelin-contracts/contracts/",
16-
"erc721a=lib/erc721a/contracts/",
17-
"erc721a-upgradeable=lib/erc721a-upgradeable/contracts/",
18-
"operator-filter-registry=lib/operator-filter-registry/src/"
13+
"forge-std=test/utils/forge-std/"
1914
]
2015

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

2419
[profile.default.fuzz]
2520
runs = 256
26-
27-
[profile.intense-0.fuzz]
28-
runs = 5_000
29-
30-
[profile.intense-1.fuzz]
31-
seed = 0x12345678
32-
runs = 5_000
33-
34-
[profile.via-ir]
35-
via_ir = true
36-
37-
[profile.via-ir.fuzz]
38-
runs = 1_000
39-
40-
[profile.min-solc]
41-
solc_version = '0.8.13'
42-
43-
[profile.min-solc.fuzz]
44-
runs = 1_000
45-
46-
[profile.min-solc-via-ir]
47-
via_ir = true
48-
solc_version = '0.8.13'
49-
50-
[profile.min-solc-via-ir.fuzz]
51-
runs = 1_000

lib/forge-std

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/Multicaller.t.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ contract MulticallerTest is TestPlus {
447447
}
448448
}
449449

450-
function _generateSignature(_TestTemps memory t) internal {
450+
function _generateSignature(_TestTemps memory t) internal view {
451451
unchecked {
452452
bytes32[] memory dataHashes = new bytes32[](t.data.length);
453453
for (uint256 i; i < t.data.length; ++i) {
@@ -929,7 +929,7 @@ contract MulticallerTest is TestPlus {
929929
uint256[] memory nonces,
930930
address signer,
931931
uint256 privateKey
932-
) internal returns (bytes memory signature) {
932+
) internal view returns (bytes memory signature) {
933933
bytes32 digest = keccak256(
934934
abi.encodePacked(
935935
"\x19\x01",
@@ -952,6 +952,7 @@ contract MulticallerTest is TestPlus {
952952

953953
function _generateIncrementNonceSaltSignature(address signer, uint256 privateKey)
954954
internal
955+
view
955956
returns (bytes memory signature)
956957
{
957958
bytes32 digest = keccak256(

test/utils/forge-std/Script.sol

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.6.0 <0.9.0;
3+
4+
import "./Vm.sol";
5+
6+
abstract contract Script {
7+
bool public IS_SCRIPT = true;
8+
9+
/// @dev `address(bytes20(uint160(uint256(keccak256("hevm cheat code")))))`.
10+
Vm public constant vm = Vm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
11+
}

0 commit comments

Comments
 (0)