Files
lmsr-amm/bin/gas-report
2025-11-11 12:46:58 -04:00

20 lines
566 B
Bash
Executable File

#!/bin/bash
report() {
REPORT=$(forge test --mc GasTest --mt "$1" --gas-report)
SWAP=$(echo "$REPORT" | grep 'swap ' | cut -d '|' -f 5 | xargs)
MINT=$(echo "$REPORT" | grep 'mint ' | cut -d '|' -f 5 | xargs)
SWAPMINT=$(echo "$REPORT" | grep 'swapMint ' | cut -d '|' -f 5 | xargs)
printf "%-10s %10s %10s %10s\n" "$1" "$SWAP" "$MINT" "$SWAPMINT"
}
# Print header
printf "%-10s %10s %10s %10s\n" "" "swap" "mint" "swapMint"
printf "%s\n" " ------ --------- ---------"
report GasPair
report StablePair
report Ten
report Twenty
report Fifty