Skip to content
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

πŸ‘·β€β™‚οΈ Update CI #36

Merged
merged 5 commits into from
Apr 8, 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
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)
47 changes: 47 additions & 0 deletions .github/workflows/ci-all-via-ir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: ci-all-via-ir

on:
workflow_dispatch:

jobs:
tests:
name: Forge Testing all via-ir
runs-on: ubuntu-latest

strategy:
matrix:
profile: [via-ir-0,via-ir-1]

steps:
- uses: actions/checkout@v4

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Dependencies
run: forge install

- name: Run Tests with ${{ matrix.profile }}
run: >
( [ "${{ matrix.profile }}" = "via-ir-0" ] &&
forge test --use 0.8.14 --via-ir &&
forge test --use 0.8.15 --via-ir &&
forge test --use 0.8.16 --via-ir &&
forge test --use 0.8.17 --via-ir &&
forge test --use 0.8.13 --via-ir &&
forge test --use 0.8.12 --via-ir &&
forge test --use 0.8.11 --via-ir &&
forge test --use 0.8.10 --via-ir
) ||
( [ "${{ matrix.profile }}" = "via-ir-1" ] &&
forge test --use 0.8.25 --via-ir &&
forge test --use 0.8.24 --via-ir &&
forge test --use 0.8.23 --via-ir &&
forge test --use 0.8.22 --via-ir &&
forge test --use 0.8.21 --via-ir &&
forge test --use 0.8.20 --via-ir &&
forge test --use 0.8.19 --via-ir &&
forge test --use 0.8.18 --via-ir
)
104 changes: 76 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,96 @@
name: ci

on: [push]

on:
pull_request:
branches: [main]
paths:
- '**.sol'
- '**.yml'
push:
branches: [main]
paths:
- '**.sol'
- '**.yml'
jobs:
tests:
name: Forge Testing
runs-on: ubuntu-latest

strategy:
matrix:
profile: [via-ir,min-solc,min-solc-via-ir,intense,solc-past-versions-0,solc-past-versions-1]
profile: [post-cancun,post-cancun-via-ir,solc-past-versions-0,solc-past-versions-1,via-ir,min-solc,min-solc-via-ir,intense]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Dependencies
run: forge install

- name: Run Lint Check
run: forge fmt --check

- name: Run Tests with ${{ matrix.profile }}
run: >
( [ "${{ matrix.profile }}" = "solc-past-versions-0" ] &&
forge test --use 0.8.5 &&
forge test --use 0.8.6 &&
forge test --use 0.8.7 &&
forge test --use 0.8.8 &&
forge test --use 0.8.9 &&
forge test --use 0.8.10 &&
forge test --use 0.8.11
) ||
( [ "${{ matrix.profile }}" = "solc-past-versions-1" ] &&
forge test --use 0.8.12 &&
forge test --use 0.8.13 &&
forge test --use 0.8.14 &&
forge test --use 0.8.15 &&
forge test --use 0.8.16 &&
forge test --use 0.8.17 &&
forge test --use 0.8.18
) ||
FOUNDRY_PROFILE=${{ matrix.profile }} forge test
( [ "${{ matrix.profile }}" = "post-cancun" ] &&
forge test --use 0.8.25 --evm-version "cancun"
) ||
( [ "${{ matrix.profile }}" = "post-cancun-via-ir" ] &&
forge test --use 0.8.25 --evm-version "cancun" --via-ir
) ||
( [ "${{ matrix.profile }}" = "solc-past-versions-0" ] &&
forge test --use 0.8.5 --fuzz-runs 16 &&
forge test --use 0.8.6 --fuzz-runs 16 &&
forge test --use 0.8.7 --fuzz-runs 16 &&
forge test --use 0.8.8 --fuzz-runs 16 &&
forge test --use 0.8.9 --fuzz-runs 16 &&
forge test --use 0.8.10 --fuzz-runs 16 &&
forge test --use 0.8.11 --fuzz-runs 16 &&
forge test --use 0.8.12 --fuzz-runs 16
) ||
( [ "${{ matrix.profile }}" = "solc-past-versions-1" ] &&
forge test --use 0.8.13 --fuzz-runs 16 &&
forge test --use 0.8.14 --fuzz-runs 16 &&
forge test --use 0.8.15 --fuzz-runs 16 &&
forge test --use 0.8.16 --fuzz-runs 16 &&
forge test --use 0.8.17 --fuzz-runs 16 &&
forge test --use 0.8.18 --fuzz-runs 16 &&
forge test --use 0.8.19 --fuzz-runs 16 &&
forge test --use 0.8.20 --fuzz-runs 16 &&
forge test --use 0.8.21 --fuzz-runs 16 &&
forge test --use 0.8.22 --fuzz-runs 16 &&
forge test --use 0.8.23 --fuzz-runs 16 &&
forge test --use 0.8.24 --fuzz-runs 16
) ||
( [ "${{ matrix.profile }}" = "via-ir" ] &&
forge test --via-ir
) ||
( [ "${{ matrix.profile }}" = "min-solc" ] &&
forge fmt --check &&
forge test --use 0.8.4
) ||
( [ "${{ matrix.profile }}" = "min-solc-via-ir" ] &&
forge test --use 0.8.13 --via-ir
) ||
( [ "${{ matrix.profile }}" = "intense" ] &&
forge test --fuzz-runs 5000
)

codespell:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run codespell
uses: codespell-project/[email protected]
with:
check_filenames: true
ignore_words_list: usera
skip: ./.git,package-lock.json,ackee-blockchain-solady-report.pdf,EIP712Mock.sol
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![NPM][npm-shield]][npm-url]
[![CI][ci-shield]][ci-url]
[![Solidity][solidity-shield]][solidity-ci-url]

Efficiently call multiple contracts in a single transaction.

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

[ci-shield]: https://img.shields.io/github/actions/workflow/status/vectorized/multicaller/ci.yml?label=build&branch=main
[ci-url]: https://github.com/vectorized/multicaller/actions/workflows/ci.yml

[solidity-shield]: https://img.shields.io/badge/solidity-%3E=0.8.10%20%3C=0.8.25-aa6746
[solidity-ci-url]: https://github.com/Vectorized/solady/actions/workflows/ci-all-via-ir.yml
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