diff --git a/cyfrinup/cyfrinup b/cyfrinup/cyfrinup deleted file mode 100755 index 58736785a..000000000 --- a/cyfrinup/cyfrinup +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash -set -e - -# TODO: Adjust this after merge -DYNAMIC_SCRIPT_URL="https://raw.githubusercontent.com/Cyfrin/aderyn/master/cyfrinup/dynamic_script" - -# Keep it minimal -main() { - need_cmd curl - ensure curl -L "$DYNAMIC_SCRIPT_URL" | bash -} - -need_cmd() { - if ! check_cmd "$1"; then - err "need '$1' (command not found)" - fi -} - -check_cmd() { - command -v "$1" > /dev/null 2>&1 -} - -# Run a command that should never fail. If the command fails execution -# will immediately terminate with an error showing the failing -# command. -ensure() { - if ! "$@"; then err "command failed: $*"; fi -} - -# --- Adding a banner --- -banner() { - printf " - -⠀⠀⠀⡠⠔⠂⠁⠀⠀⠀⠀⠀⠈⠐⡂⠀⠀ █████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ ███╗ ██╗ -⠀⡠⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⢈⣀⡀ ██╔══██╗ ██╔══██╗ ██╔════╝ ██╔══██╗ ╚██╗ ██╔╝ ████╗ ██║ -⠰⠀⠀⠀⢠⢆⣤⣆⠀⠀⠤⠤⠄⢀⡀⠑⠀ ███████║ ██║ ██║ █████╗ ██████╔╝ ╚████╔╝ ██╔██╗ ██║ -⡌⠊⠒⠠⡁⠈⠛⠋⡠⠊⠀⠠⠀⠀⠀⠀⠉ ██╔══██║ ██║ ██║ ██╔══╝ ██╔══██╗ ╚██╔╝ ██║╚██╗██║ -⡅⠀⢀⣰⣧⠁⠀⠉⠀⠀⢀⠂⠀⠀⠀⠀⣠ ██║ ██║ ██████╔╝ ███████╗ ██║ ██║ ██║ ██║ ╚████║ -⠇⣬⣿⣿⣿⠀⠀⠀⠀⠠⠂⠀⠀⠀⢄⣴⣿ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ -⠈⠻⣗⡀⢡⢁⠀⢀⠔⠁⠀⠀⠀⢠⣿⣿⣿ -⠀⠀⠀⠁⠈⡀⠒⠃⠀⠀⠀⠀⠀⠸⣿⣿⡿ A powerful Solidity static analyzer that takes a -⠀⠀⠀⠀⠀⠁⠀⠀⡀⠀⠀⠀⠀⡄⢸⠚⠃ bird's eye view over your smart contracts. -⠀⠀⠀⠀⠀⠇⠀⢠⠁⠀⡀⠀⢠⠀⡚⠀⠀ -⠀⠀⠀⠀⠘⠀⠂⠀⡀⠔⡅⡠⠂⠉ Official Docs - https://docs.cyfrin.io/ - - ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴄʏꜰʀɪɴ - - " -} - -# Calling banner function -banner - -main "$@" || exit 1 \ No newline at end of file diff --git a/cyfrinup/dynamic_script b/cyfrinup/dynamic_script index 7c0210356..0fe9de6a6 100755 --- a/cyfrinup/dynamic_script +++ b/cyfrinup/dynamic_script @@ -1,28 +1,12 @@ #!/usr/bin/env bash set -e +DYNAMIC_SCRIPT_URL="https://raw.githubusercontent.com/Cyfrin/up/main/dynamic_script" + +# Keep it minimal main() { need_cmd curl - - say "installing latest aderyn" - - ensure curl --proto '=https' --tlsv1.2 -LsSf https://github.com/cyfrin/aderyn/releases/latest/download/aderyn-installer.sh | bash - rm -f ~/.cyfrin/bin/aderyn - - say "done!" -} - -say() { - printf 'cyfrinup: %s\n' "$1" -} - -warn() { - say "warning: ${1}" >&2 -} - -err() { - say "$1" >&2 - exit 1 + ensure curl -L "$DYNAMIC_SCRIPT_URL" | bash } need_cmd() { diff --git a/cyfrinup/install b/cyfrinup/install deleted file mode 100755 index d14639a4d..000000000 --- a/cyfrinup/install +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -# ----------------------------------------------------------- -# Forked from Foundry. -# https://github.com/foundry-rs/foundry/tree/master/foundryup -# ----------------------------------------------------------- - -# --- Adding a banner --- -banner() { - printf " - -⠀⠀⠀⡠⠔⠂⠁⠀⠀⠀⠀⠀⠈⠐⡂⠀⠀ █████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ ███╗ ██╗ -⠀⡠⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⢈⣀⡀ ██╔══██╗ ██╔══██╗ ██╔════╝ ██╔══██╗ ╚██╗ ██╔╝ ████╗ ██║ -⠰⠀⠀⠀⢠⢆⣤⣆⠀⠀⠤⠤⠄⢀⡀⠑⠀ ███████║ ██║ ██║ █████╗ ██████╔╝ ╚████╔╝ ██╔██╗ ██║ -⡌⠊⠒⠠⡁⠈⠛⠋⡠⠊⠀⠠⠀⠀⠀⠀⠉ ██╔══██║ ██║ ██║ ██╔══╝ ██╔══██╗ ╚██╔╝ ██║╚██╗██║ -⡅⠀⢀⣰⣧⠁⠀⠉⠀⠀⢀⠂⠀⠀⠀⠀⣠ ██║ ██║ ██████╔╝ ███████╗ ██║ ██║ ██║ ██║ ╚████║ -⠇⣬⣿⣿⣿⠀⠀⠀⠀⠠⠂⠀⠀⠀⢄⣴⣿ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ -⠈⠻⣗⡀⢡⢁⠀⢀⠔⠁⠀⠀⠀⢠⣿⣿⣿ -⠀⠀⠀⠁⠈⡀⠒⠃⠀⠀⠀⠀⠀⠸⣿⣿⡿ A powerful Solidity static analyzer that takes a -⠀⠀⠀⠀⠀⠁⠀⠀⡀⠀⠀⠀⠀⡄⢸⠚⠃ bird's eye view over your smart contracts. -⠀⠀⠀⠀⠀⠇⠀⢠⠁⠀⡀⠀⢠⠀⡚⠀⠀ -⠀⠀⠀⠀⠘⠀⠂⠀⡀⠔⡅⡠⠂⠉ Official Docs - https://docs.cyfrin.io/ - - ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴄʏꜰʀɪɴ - - " -} - -# Calling banner function -banner - -echo Installing cyfrinup... - -BASE_DIR="${XDG_CONFIG_HOME:-$HOME}" -CYFRIN_DIR="${CYFRIN_DIR:-"$BASE_DIR/.cyfrin"}" -CYFRIN_BIN_DIR="$CYFRIN_DIR/bin" - -CYFRINUP_URL="https://raw.githubusercontent.com/Cyfrin/aderyn/master/cyfrinup/cyfrinup" -BIN_PATH="$CYFRIN_BIN_DIR/cyfrinup" - -# Create the .cyfrin bin directory and huffup binary if it doesn't exist. -mkdir -p $CYFRIN_BIN_DIR -curl -# -L $CYFRINUP_URL -o $BIN_PATH -chmod +x $BIN_PATH - -# Store the correct profile file (i.e. .profile for bash or .zshrc for ZSH). -case $SHELL in -*/zsh) - PROFILE="${ZDOTDIR-"$HOME"}/.zshenv" - PREF_SHELL=zsh - ;; -*/bash) - PROFILE=$HOME/.bashrc - PREF_SHELL=bash - ;; -*/fish) - PROFILE=$HOME/.config/fish/config.fish - PREF_SHELL=fish - ;; -*/ash) - PROFILE=$HOME/.profile - PREF_SHELL=ash - ;; -*) - echo "cyfrinup: could not detect shell, manually add ${CYFRIN_BIN_DIR} to your PATH." - exit 1 -esac - -# Only add cyfrinup if it isn't already in PATH. -if [[ ":$PATH:" != *":${CYFRIN_BIN_DIR}:"* ]]; then - # Add the cyfrinup directory to the path and ensure the old PATH variables remain. - if [[ "$PREF_SHELL" == "fish" ]]; then - echo >> "$PROFILE" && echo "fish_add_path -a $CYFRIN_BIN_DIR" >> "$PROFILE" - else - echo >> "$PROFILE" && echo "export PATH=\"\$PATH:$CYFRIN_BIN_DIR\"" >> "$PROFILE" - fi -fi - -# Export the PATH directly in the current session -export PATH="$PATH:$CYFRIN_BIN_DIR" - -echo && echo "Detected your preferred shell is ${PREF_SHELL} and added cyfrinup to PATH. Run 'source ${PROFILE}' or start a new terminal session to use cyfrin." -echo "Then, simply run 'cyfrinup' to install Cyfrin tool suite" \ No newline at end of file diff --git a/cyfrinup/why.md b/cyfrinup/why.md new file mode 100644 index 000000000..e35ac2f00 --- /dev/null +++ b/cyfrinup/why.md @@ -0,0 +1,10 @@ +Why does this file dynamic_script exist ? + +* To support existing cyfrinup users (The ones who installed cyfrinup from aderyn) +* The new way to install cyfrinup is from https://github.com/Cyfrin/up + +* Don't change the location (cyfrinup/dynamic_script) +* Don't delete this branch (master branch) +* Don't rename this branch (master branch) + +IMPORTANT