Skip to content

Commit

Permalink
Merge pull request #515 from sablier-labs/build/out-optimized
Browse files Browse the repository at this point in the history
build: rename "optimized-out" to "out-optimized"
  • Loading branch information
PaulRBerg authored May 28, 2023
2 parents e18414f + 7d2c880 commit 0a28b97
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-deep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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\""
Expand Down Expand Up @@ -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\""
Expand Down Expand Up @@ -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\""
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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\""
Expand Down Expand Up @@ -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\""
Expand Down Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cache
coverage
docs
node_modules
optimized-out
out-optimized
out

# files
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ coverage
docs
lib
node_modules
optimized-out
out-optimized
out
script
src
Expand Down
6 changes: 3 additions & 3 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -34,7 +34,7 @@

# Compile only the production code with IR
[profile.optimized]
out = "optimized-out"
out = "out-optimized"
test = "src"
via_ir = true

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,}?\"",
Expand Down
28 changes: 14 additions & 14 deletions shell/prepare-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions test/Base.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
}

Expand All @@ -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())
)
);
Expand All @@ -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_))
)
);
Expand Down

0 comments on commit 0a28b97

Please sign in to comment.