CREATE2 callback validation; init code storage contracts

This commit is contained in:
tim
2025-11-13 16:41:52 -04:00
parent c2ac0e3624
commit 9273430f2a
28 changed files with 779 additions and 588 deletions

View File

@@ -3,7 +3,13 @@
report() {
local name=${2:-$1}
REPORT=$(forge test --mc GasTest --mt "$1" --gas-report)
SWAP=$(echo "$REPORT" | grep 'swap ' | cut -d '|' -f 5 | xargs)
SWAP=$(echo "$REPORT" | grep 'swapApproval ' | cut -d '|' -f 5 | xargs)
if [ -z "$SWAP" ]; then
SWAP=$(echo "$REPORT" | grep 'swapPrefund ' | cut -d '|' -f 5 | xargs)
fi
if [ -z "$SWAP" ]; then
SWAP=$(echo "$REPORT" | grep 'swapCallback ' | cut -d '|' -f 5 | xargs)
fi
MINT=$(echo "$REPORT" | grep 'mint ' | cut -d '|' -f 5 | xargs)
SWAPMINT=$(echo "$REPORT" | grep 'swapMint ' | cut -d '|' -f 5 | xargs)
printf "%-15s %10s %10s %10s\n" "$name" "$SWAP" "$MINT" "$SWAPMINT"
@@ -15,8 +21,11 @@ printf "%s\n" " ------ --------- ---------"
report GasPair Pair
report StablePair "Stable Pair"
report PrefundingSP "SPair prefund"
report Ten
report Callback "Ten-callback"
report Prefunding "Ten-prefunding"
report Prefunding10 "Ten prefund"
report Callback10 "Ten callback"
report Twenty
report Prefunding20 "Twenty prefund"
report Callback20 "Twenty callback"
report Fifty