#!/usr/bin/env bash # Exports the ABI (only) of the 8 KIBBLE contracts to contracts/abi/.json. # Usage: ./script/export-abis.sh (runs forge build first) set -euo pipefail cd "$(dirname "$0")/.." forge build >/dev/null mkdir -p abi for name in KibbleToken Miner Emission Genesis Zapper Burner Oracle LpLocker; do if command -v jq >/dev/null 2>&1; then jq '.abi' "out/${name}.sol/${name}.json" > "abi/${name}.json" else node -e 'const fs=require("fs");const a=JSON.parse(fs.readFileSync(process.argv[1])).abi;fs.writeFileSync(process.argv[2],JSON.stringify(a,null,2)+"\n")' \ "out/${name}.sol/${name}.json" "abi/${name}.json" fi echo "abi/${name}.json" done