Skip to content
Merged
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
28 changes: 28 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ install_node()
popd >/dev/null
}

install_foundry()
{
if [[ -d "$TARGET" ]] && [[ -f "$TARGET/foundry.toml" ]]; then
echo "[-] Foundry target detected, installing foundry nightly"

wget -q -O foundryup https://raw.githubusercontent.com/foundry-rs/foundry/36a66c857ff148f6ed007cdcd3402077de3595cf/foundryup/foundryup
if [ ! "c0c6711dc39deae65bebcc0320fec1265930895a527e18daa643a708218c07ae foundryup" = "$(sha256sum foundryup)" ]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

echo "Foundry installer does not match expected checksum! exiting"
exit 1
fi

export FOUNDRY_DIR="/opt/foundry"
export PATH="$FOUNDRY_DIR/bin:$PATH"
mkdir -p "$FOUNDRY_DIR/bin" "$FOUNDRY_DIR/share/man/man1"
bash foundryup
rm foundryup
fi
}

install_slither()
{
SLITHERPKG="slither-analyzer"
Expand Down Expand Up @@ -113,6 +132,14 @@ install_deps()
echo "[-] Did not find a requirements.txt, proceeding without installing Python dependencies."
fi

# Foundry dependencies
if [[ -f foundry.toml ]]; then
echo "[-] Installing dependencies from foundry.toml"
forge install
else
echo "[-] Did not find a foundry.toml, proceeding without installing Foundry dependencies."
fi

popd >/dev/null
fi
}
Expand All @@ -123,6 +150,7 @@ IGNORECOMPILEFLAG=
if [[ -z "$IGNORECOMPILE" || $IGNORECOMPILE =~ ^[Ff]alse$ ]]; then
install_solc
install_node
install_foundry
install_deps
else
IGNORECOMPILEFLAG="--ignore-compile"
Expand Down