-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add makefile, fix foundry.toml and ci (#10)
* add makefile, fix foundry.toml and ci * Upgrade solc_version
- Loading branch information
Showing
4 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM ghcr.io/foundry-rs/foundry@sha256:8b843eb65cc7b155303b316f65d27173c862b37719dc095ef3a2ef27ce8d3c00 as builder | ||
|
||
WORKDIR /app | ||
COPY foundry.toml foundry.toml | ||
COPY lib lib | ||
COPY src src | ||
|
||
RUN FOUNDRY_PROFILE=prod forge build | ||
|
||
FROM scratch AS foundry-export | ||
|
||
COPY --from=builder /app/out . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
all: build | ||
|
||
####################### | ||
## BUILD | ||
|
||
.PHONY: build | ||
build: | ||
forge build | ||
|
||
.PHONY: clean | ||
clean: | ||
forge clean | ||
|
||
.PHONY: build-prod | ||
build-prod: clean | ||
docker build --target foundry-export -f Dockerfile -o out . | ||
|
||
####################### | ||
## TESTS | ||
|
||
.PHONY: check-format | ||
check-format: | ||
forge fmt --check | ||
|
||
.PHONY: fix-format | ||
fix-format: | ||
forge fmt | ||
|
||
.PHONY: test | ||
test: | ||
forge test -vvv | ||
|
||
# Verify that the contracts do not include PUSH0 opcodes | ||
test-push0: | ||
forge build --extra-output evm.bytecode.opcodes | ||
@if grep -qr --include \*.json PUSH0 ./evm/out; then echo "Contract uses PUSH0 instruction" 1>&2; exit 1; else echo "PUSH0 Verification Succeeded"; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
[profile.default] | ||
solc_version = "0.8.23" | ||
optimizer = true | ||
optimizer_runs = 200 | ||
via_ir = false | ||
evm_version = "london" | ||
src = "src" | ||
out = "out" | ||
libs = ["lib"] | ||
fs_permissions = [{ access = "read", path = "./test/payloads"}] | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options | ||
[profile.prod] | ||
via_ir = true | ||
fs_permissions = [{access = "read", path = "./cfg/"}] | ||
|
||
[fmt] | ||
line_length = 100 | ||
multiline_func_header = "params_first" | ||
# wrap_comments = true | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options |