diff --git a/.github/workflows/ci-deep.yml b/.github/workflows/ci-deep.yml index a6bcac903..05cccabdc 100644 --- a/.github/workflows/ci-deep.yml +++ b/.github/workflows/ci-deep.yml @@ -79,7 +79,7 @@ jobs: - name: "Cache the build so that it can be re-used by the other jobs" uses: "actions/cache/save@v3" with: - path: "optimized-out" + path: "out-optimized" key: "foundry-build-${{ github.sha }}" - name: "Add build summary" @@ -106,7 +106,7 @@ jobs: with: fail-on-cache-miss: true key: "foundry-build-${{ github.sha }}" - path: "optimized-out" + path: "out-optimized" - name: "Run the integration tests against the optimized build" run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/integration\"" @@ -136,7 +136,7 @@ jobs: with: fail-on-cache-miss: true key: "foundry-build-${{ github.sha }}" - path: "optimized-out" + path: "out-optimized" - name: "Run the invariant tests against the optimized build" run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/invariant\"" @@ -165,7 +165,7 @@ jobs: with: fail-on-cache-miss: true key: "foundry-build-${{ github.sha }}" - path: "optimized-out" + path: "out-optimized" - name: "Run the fork tests against the optimized build" run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/fork\"" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef8a95edf..1eea5676e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: - name: "Cache the build so that it can be re-used by the other jobs" uses: "actions/cache/save@v3" with: - path: "optimized-out" + path: "out-optimized" key: "foundry-build-${{ github.sha }}" - name: "Store the contract artifacts in CI" @@ -115,7 +115,7 @@ jobs: with: fail-on-cache-miss: true key: "foundry-build-${{ github.sha }}" - path: "optimized-out" + path: "out-optimized" - name: "Run the integration tests against the optimized build" run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/integration\"" @@ -170,7 +170,7 @@ jobs: with: fail-on-cache-miss: true key: "foundry-build-${{ github.sha }}" - path: "optimized-out" + path: "out-optimized" - name: "Run the invariant tests against the optimized build" run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/invariant\"" @@ -199,7 +199,7 @@ jobs: with: fail-on-cache-miss: true key: "foundry-build-${{ github.sha }}" - path: "optimized-out" + path: "out-optimized" - name: "Generate fuzz seed that changes weekly to avoid burning through RPC allowance" run: | diff --git a/.gitignore b/.gitignore index 133a9ea08..300068128 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ cache coverage docs node_modules -optimized-out +out-optimized out # files diff --git a/.prettierignore b/.prettierignore index 4f8b958bf..b0dc0d8d8 100644 --- a/.prettierignore +++ b/.prettierignore @@ -6,7 +6,7 @@ coverage docs lib node_modules -optimized-out +out-optimized out script src diff --git a/foundry.toml b/foundry.toml index 5993e2176..9c7c0a42e 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,7 +3,7 @@ bytecode_hash = "none" cbor_metadata = false emv_version = "paris" - fs_permissions = [{ access = "read", path = "optimized-out" }] + fs_permissions = [{ access = "read", path = "out-optimized" }] libs = ["lib"] gas_reports = [ "SablierV2Comptroller", @@ -34,7 +34,7 @@ # Compile only the production code with IR [profile.optimized] - out = "optimized-out" + out = "out-optimized" test = "src" via_ir = true @@ -43,7 +43,7 @@ ignored_error_codes = [ 7737, # Disable inline assembly warnings ] - out = "optimized-out" + out = "out-optimized" script = "src" test = "src" via_ir = true diff --git a/package.json b/package.json index dfa5de891..55df768b4 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "build": "forge build", "build:optimized": "FOUNDRY_PROFILE=optimized forge build", "build:smt": "FOUNDRY_PROFILE=smt forge build", - "clean": "rm -rf artifacts broadcast cache docs optimized-out out", + "clean": "rm -rf artifacts broadcast cache docs out-optimized out", "gas:report": "forge test --gas-report --match-path \"./test/integration\" --no-match-test \"test(Fuzz)?_RevertWhen_\\w{1,}?\"", "gas:snapshot": "forge snapshot --match-path \"./test/integration\" --no-match-test \"test(Fuzz)?_RevertWhen_\\w{1,}?\"", "gas:snapshot:optimized": "pnpm build:optimized && FOUNDRY_PROFILE=test-optimized forge snapshot --match-path \"./test/integration\" --no-match-test \"test(Fork)?(Fuzz)?_RevertWhen_\\w{1,}?\"", diff --git a/shell/prepare-artifacts.sh b/shell/prepare-artifacts.sh index 532c04e48..7a07d6dfc 100755 --- a/shell/prepare-artifacts.sh +++ b/shell/prepare-artifacts.sh @@ -26,30 +26,30 @@ mkdir $artifacts \ FOUNDRY_PROFILE=optimized forge build # Copy the production artifacts -cp optimized-out/SablierV2Comptroller.sol/SablierV2Comptroller.json $artifacts -cp optimized-out/SablierV2LockupDynamic.sol/SablierV2LockupDynamic.json $artifacts -cp optimized-out/SablierV2LockupLinear.sol/SablierV2LockupLinear.json $artifacts +cp out-optimized/SablierV2Comptroller.sol/SablierV2Comptroller.json $artifacts +cp out-optimized/SablierV2LockupDynamic.sol/SablierV2LockupDynamic.json $artifacts +cp out-optimized/SablierV2LockupLinear.sol/SablierV2LockupLinear.json $artifacts interfaces=./artifacts/interfaces -cp optimized-out/ISablierV2Base.sol/ISablierV2Base.json $interfaces -cp optimized-out/ISablierV2Comptroller.sol/ISablierV2Comptroller.json $interfaces -cp optimized-out/ISablierV2Lockup.sol/ISablierV2Lockup.json $interfaces -cp optimized-out/ISablierV2LockupDynamic.sol/ISablierV2LockupDynamic.json $interfaces -cp optimized-out/ISablierV2LockupLinear.sol/ISablierV2LockupLinear.json $interfaces +cp out-optimized/ISablierV2Base.sol/ISablierV2Base.json $interfaces +cp out-optimized/ISablierV2Comptroller.sol/ISablierV2Comptroller.json $interfaces +cp out-optimized/ISablierV2Lockup.sol/ISablierV2Lockup.json $interfaces +cp out-optimized/ISablierV2LockupDynamic.sol/ISablierV2LockupDynamic.json $interfaces +cp out-optimized/ISablierV2LockupLinear.sol/ISablierV2LockupLinear.json $interfaces erc20=./artifacts/interfaces/erc20 -cp optimized-out/IERC20.sol/IERC20.json $erc20 +cp out-optimized/IERC20.sol/IERC20.json $erc20 erc721=./artifacts/interfaces/erc721 -cp optimized-out/IERC721.sol/IERC721.json $erc721 -cp optimized-out/IERC721Metadata.sol/IERC721Metadata.json $erc721 +cp out-optimized/IERC721.sol/IERC721.json $erc721 +cp out-optimized/IERC721Metadata.sol/IERC721Metadata.json $erc721 hooks=./artifacts/interfaces/hooks -cp optimized-out/ISablierV2LockupRecipient.sol/ISablierV2LockupRecipient.json $hooks -cp optimized-out/ISablierV2LockupSender.sol/ISablierV2LockupSender.json $hooks +cp out-optimized/ISablierV2LockupRecipient.sol/ISablierV2LockupRecipient.json $hooks +cp out-optimized/ISablierV2LockupSender.sol/ISablierV2LockupSender.json $hooks libraries=./artifacts/libraries -cp optimized-out/Errors.sol/Errors.json $libraries +cp out-optimized/Errors.sol/Errors.json $libraries # Format the artifacts with Prettier pnpm prettier --write ./artifacts diff --git a/test/Base.t.sol b/test/Base.t.sol index 78d961409..4cce1340e 100644 --- a/test/Base.t.sol +++ b/test/Base.t.sol @@ -135,7 +135,7 @@ abstract contract Base_Test is Assertions, Calculations, Constants, Events, Fuzz /// @dev Deploys {SablierV2Comptroller} from a source precompiled with `--via-ir`. function deployPrecompiledComptroller(address initialAdmin) internal returns (ISablierV2Comptroller comptroller_) { comptroller_ = ISablierV2Comptroller( - deployCode("optimized-out/SablierV2Comptroller.sol/SablierV2Comptroller.json", abi.encode(initialAdmin)) + deployCode("out-optimized/SablierV2Comptroller.sol/SablierV2Comptroller.json", abi.encode(initialAdmin)) ); } @@ -150,7 +150,7 @@ abstract contract Base_Test is Assertions, Calculations, Constants, Events, Fuzz { dynamic_ = ISablierV2LockupDynamic( deployCode( - "optimized-out/SablierV2LockupDynamic.sol/SablierV2LockupDynamic.json", + "out-optimized/SablierV2LockupDynamic.sol/SablierV2LockupDynamic.json", abi.encode(initialAdmin, address(comptroller_), address(nftDescriptor_), defaults.MAX_SEGMENT_COUNT()) ) ); @@ -167,7 +167,7 @@ abstract contract Base_Test is Assertions, Calculations, Constants, Events, Fuzz { linear_ = ISablierV2LockupLinear( deployCode( - "optimized-out/SablierV2LockupLinear.sol/SablierV2LockupLinear.json", + "out-optimized/SablierV2LockupLinear.sol/SablierV2LockupLinear.json", abi.encode(initialAdmin, address(comptroller_), address(nftDescriptor_)) ) );