prefunding

This commit is contained in:
tim
2025-11-11 18:33:14 -04:00
parent ddfe7651ea
commit 70960630ce
8 changed files with 722 additions and 69 deletions

View File

@@ -1,19 +1,22 @@
#!/bin/bash
report() {
local name=${2:-$1}
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"
printf "%-15s %10s %10s %10s\n" "$name" "$SWAP" "$MINT" "$SWAPMINT"
}
# Print header
printf "%-10s %10s %10s %10s\n" "" "swap" "mint" "swapMint"
printf "%s\n" " ------ --------- ---------"
printf "%-15s %10s %10s %10s\n" "" "swap" "mint" "swapMint"
printf "%s\n" " ------ --------- ---------"
report GasPair
report StablePair
report GasPair Pair
report StablePair "Stable Pair"
report Ten
report Callback "Ten-callback"
report Prefunding "Ten-prefunding"
report Twenty
report Fifty