sepolia deployment
This commit is contained in:
31
bin/generate-contracts
Executable file
31
bin/generate-contracts
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
CHAIN_ID=${1:-31337}
|
||||
|
||||
if [ "$CHAIN_ID" = "31337" ]; then
|
||||
ABI_PATH=../lmsr-amm/out
|
||||
METADATA_PATH=../lmsr-amm/liqp-deployments.json
|
||||
else
|
||||
ABI_PATH=../lmsr-amm/deployment/$1/v1/out
|
||||
METADATA_PATH=../lmsr-amm/deployment/liqp-deployments.json
|
||||
fi
|
||||
|
||||
if [ ! -f "$ABI_PATH/IPartyPool.sol/IPartyPool.json" ]; then
|
||||
echo "Invalid chain ID $CHAIN_ID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo Chain $CHAIN_ID
|
||||
|
||||
generate() {
|
||||
ABI=$(jq '.abi' $ABI_PATH/$1.sol/$1.json)
|
||||
echo "/* GENERATED FILE: DO NOT EDIT! */\n\nconst ${1}ABI = ${ABI} as const;\n\nexport default ${1}ABI;" > ./src/contracts/$1ABI.ts
|
||||
echo "src/contracts/$1ABI.ts"
|
||||
}
|
||||
|
||||
generate IPartyPlanner
|
||||
generate IPartyPool
|
||||
generate IPartyPoolViewer
|
||||
|
||||
cp "$METADATA_PATH" src/contracts/
|
||||
echo liqp-deployments.json
|
||||
Reference in New Issue
Block a user