Skip to content

Instantly share code, notes, and snippets.

View tempe-techie's full-sized avatar
🤘
Rock on!

Tempe Techie tempe-techie

🤘
Rock on!
View GitHub Profile
@johnnieskywalker
johnnieskywalker / my-echidna.dockerfile
Last active May 19, 2023 12:27
Dockerfile to run echidna with various solc versions
FROM ghcr.io/crytic/echidna/echidna:testing-master
RUN apt-get update && apt-get install -y curl
RUN ln -s /usr/local/solc-select/scripts/solc-select /usr/bin
# Install any solc version is needed for contracts
RUN solc-select install 0.8.0
RUN solc-select install 0.8.1
ENV PATH="/root/.solc-select:$PATH"
RUN solc-select use 0.8.1
@johnnieskywalker
johnnieskywalker / clean_flat_files.py
Created May 11, 2023 10:39
Script for sleaning spdx from flat .sol files, except the first one
import os
flattened_dir = "./flattened"
for filename in os.listdir(flattened_dir):
file_path = os.path.join(flattened_dir, filename)
if os.path.isfile(file_path) and filename.endswith("_flattened.sol"):
with open(file_path, "r") as f:
lines = f.readlines()
@johnnieskywalker
johnnieskywalker / flatten_contracts.sh
Created May 11, 2023 09:10
Flatten all files from contracts folder and save to flattened directory
#!/bin/bash
CONTRACTS_DIR="./contracts"
FLATTENED_DIR="./flattened"
mkdir -p "$FLATTENED_DIR"
for FILE in "${CONTRACTS_DIR}"/*.sol; do
if [[ -f "$FILE" ]] && [[ -r "$FILE" ]]; then
FILE_NAME="$(basename "${FILE%.sol}")"