Skip to content

Commit

Permalink
Updated readme and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandro-immunefi committed Nov 3, 2023
1 parent c5e9c67 commit d33abaf
Show file tree
Hide file tree
Showing 31 changed files with 16,402 additions and 814 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This repository contains all the proof of concepts (POCs) related to the article
| Yield protocol Logical Vulnerability| [YieldProtocolPoC](./test/YieldProtocol.t.sol) | [Yield Protocol Bugfix Review](https://medium.com/immunefi/) | `forge test -vvv --match-path ./test/YieldProtocol/AttackTest.t.sol`
| MEV POC| [ForgeSandwichPOC](./test/MEV/Forge/Sandwich.t.sol) | [MEV POC Article](https://medium.com/immunefi/how-to-reproduce-a-simple-mev-attack-b38151616cb4) | `forge test -vvv --match-path ./test/MEV/Forge/Sandwich.t.sol`
| Balancer Rounding Error | [BalancerPoC](./test/Balancer/rounding-error-aug2023/BalancerPoC.sol) | [Balancer Rounding Error Bugfix Review](https://medium.com/immunefi/) | `forge test -vvv --match-path ./test/Balancer/rounding-error-aug2023/BalancerPoC.sol`
| Alchemix Missing Solvency Check | [AlchemixPoX](./test/Alchemix/AttackContract.sol) | [Alchemix Missing Solvency Check](https://medium.com/immunefi/) | `forge test -vvv --match-path ./test/Alchemix/PoCTest.sol --via-ir`


## Getting Started
Expand Down
54 changes: 48 additions & 6 deletions lib/forge-std/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,68 @@ jobs:
- name: Print forge version
run: forge --version

# Backwards compatibility checks.
# Backwards compatibility checks:
# - the oldest and newest version of each supported minor version
# - versions with specific issues
- name: Check compatibility with latest
if: always()
run: |
output=$(forge build --skip test)
if echo "$output" | grep -q "Warning"; then
echo "$output"
exit 1
fi
- name: Check compatibility with 0.8.0
if: always()
run: forge build --skip test --use solc:0.8.0
run: |
output=$(forge build --skip test --use solc:0.8.0)
if echo "$output" | grep -q "Warning"; then
echo "$output"
exit 1
fi
- name: Check compatibility with 0.7.6
if: always()
run: forge build --skip test --use solc:0.7.6
run: |
output=$(forge build --skip test --use solc:0.7.6)
if echo "$output" | grep -q "Warning"; then
echo "$output"
exit 1
fi
- name: Check compatibility with 0.7.0
if: always()
run: forge build --skip test --use solc:0.7.0
run: |
output=$(forge build --skip test --use solc:0.7.0)
if echo "$output" | grep -q "Warning"; then
echo "$output"
exit 1
fi
- name: Check compatibility with 0.6.12
if: always()
run: forge build --skip test --use solc:0.6.12
run: |
output=$(forge build --skip test --use solc:0.6.12)
if echo "$output" | grep -q "Warning"; then
echo "$output"
exit 1
fi
- name: Check compatibility with 0.6.2
if: always()
run: forge build --skip test --use solc:0.6.2
run: |
output=$(forge build --skip test --use solc:0.6.2)
if echo "$output" | grep -q "Warning"; then
echo "$output"
exit 1
fi
# via-ir compilation time checks.
- name: Measure compilation time of Test with 0.8.17 --via-ir
Expand Down
29 changes: 29 additions & 0 deletions lib/forge-std/.github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Sync Release Branch

on:
release:
types:
- created

jobs:
sync-release-branch:
runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'v1')
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: v1

- name: Configure Git
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Sync Release Branch
run: |
git fetch --tags
git checkout v1
git reset --hard ${GITHUB_REF}
git push --force
2 changes: 1 addition & 1 deletion lib/forge-std/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fs_permissions = [{ access = "read-write", path = "./"}]

[rpc_endpoints]
# The RPC URLs are modified versions of the default for testing initialization.
mainnet = "https://mainnet.infura.io/v3/7a8769b798b642f6933f2ed52042bd70" # Different API key.
mainnet = "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3" # Different API key.
optimism_goerli = "https://goerli.optimism.io/" # Adds a trailing slash.
arbitrum_one_goerli = "https://goerli-rollup.arbitrum.io/rpc/" # Adds a trailing slash.
needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}"
Expand Down
41 changes: 41 additions & 0 deletions lib/forge-std/lib/ds-test/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Build"
on:
pull_request:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: setup dapp binary cache
uses: cachix/cachix-action@v12
with:
name: dapp

- name: install dapptools
run: nix profile install github:dapphub/dapptools#dapp --accept-flake-config

- name: install foundry
uses: foundry-rs/foundry-toolchain@v1

- name: test with solc-0.5.17
run: dapp --use solc-0.5.17 test -v

- name: test with solc-0.6.11
run: dapp --use solc-0.6.11 test -v

- name: test with solc-0.7.6
run: dapp --use solc-0.7.6 test -v

- name: test with solc-0.8.18
run: dapp --use solc-0.8.18 test -v

- name: Run tests with foundry
run: forge test -vvv

1 change: 1 addition & 0 deletions lib/forge-std/lib/ds-test/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.dapple
/build
/out
/cache/
Loading

0 comments on commit d33abaf

Please sign in to comment.