Sepolia redeployment

This commit is contained in:
tim
2025-10-21 15:28:38 -04:00
parent 538f778f51
commit 903f65327a
16 changed files with 166 additions and 29 deletions

9
.gitignore vendored
View File

@@ -1,15 +1,14 @@
/cache/
/out/
/docs/
/log/
/.env
/.env-*
/.idea/
# Ignores development broadcast logs
/broadcast
# Sensitive files
*secret*
bin/sepolia-deploy
/liqp-deployments.json
# This file is only used by DeployMock
/liqp-deployments.json

138
bin/sepolia-deploy Executable file
View File

@@ -0,0 +1,138 @@
#!/bin/bash
CHAINID=11155111
DEPLOY_SCRIPT=DeploySepolia
if [ -z "$SEPOLIA_RPC_URL" ]; then
echo "Usage: SEPOLIA_RPC_URL environment variable must be set"
exit 1
fi
RPC=${SEPOLIA_RPC_URL}
if [ -z "$PRIVATE_KEY" ]; then
echo "Usage: PRIVATE_KEY environment variable must be set"
exit 1
fi
if [ -z "$ETHERSCAN_API_KEY" ]; then
echo "Usage: ETHERSCAN_API_KEY environment variable must be set"
exit 1
fi
if [ "$1" == "broadcast" ]; then
# BROADCAST=(--broadcast --verify --etherscan-api-key "$ETHERSCAN_API_KEY")
# use --slow to avoid triggering rate limits
BROADCAST=(--slow --broadcast --verify --etherscan-api-key "$ETHERSCAN_API_KEY")
else
BROADCAST=()
fi
if [ "$1" != "record" ]; then
forge clean
forge script --fork-url "$RPC" --private-key "$PRIVATE_KEY" "${BROADCAST[@]}" script/DeploySepolia.sol || exit 1
fi
# Update the liqp-deployments.json file if the contracts were broadcast or record was requested
if [ "$1" == "broadcast" ] || [ "$1" == "record" ]; then
METADATA_FILE=deployment/liqp-deployments.json
else
METADATA_FILE=./liqp-deployments.json
fi
address() {
if [ -z "$1" ]; then
echo ""
else
cast --to-checksum-address "$1"
fi
}
contract() {
address "$(jq -r ".transactions[] | select(.contractName == \"$1\" and .transactionType == \"CREATE\") | .contractAddress" broadcast/${DEPLOY_SCRIPT}.sol/${CHAINID}/run-latest.json)"
}
token() {
address "$(jq -r ".transactions[] | select(.contractName == \"MockERC20\" and .transactionType == \"CREATE\" and (.arguments | contains([\"$1\"]))) | .contractAddress" broadcast/${DEPLOY_SCRIPT}.sol/${CHAINID}/run-latest.json)"
}
PARTY_PLANNER=$(contract PartyPlanner)
PARTY_POOL_VIEWER=$(contract PartyPoolViewer)
PARTY_POOL_MINT_IMPL=$(contract PartyPoolMintImpl)
PARTY_POOL_SWAP_IMPL=$(contract PartyPoolSwapImpl)
PARTY_POOL_DEPLOYER=$(contract PartyPoolDeployer)
PARTY_POOL_BP_DEPLOYER=$(contract PartyPoolBalancedPairDeployer)
USXD=$(token USXD)
FUSD=$(token FUSD)
DIVE=$(token DIVE)
BUTC=$(token BUTC)
WTETH=$(token WTETH)
OUT=deployment/$CHAINID/v1
mkdir -p $OUT
cp -r out $OUT/
# Build and insert the JSON object directly in jq
jq -n \
--arg chainId "$CHAINID" \
--arg partyPlanner "$PARTY_PLANNER" \
--arg partyPoolViewer "$PARTY_POOL_VIEWER" \
--arg partyPoolMintImpl "$PARTY_POOL_MINT_IMPL" \
--arg partyPoolSwapImpl "$PARTY_POOL_SWAP_IMPL" \
--arg partyPoolDeployer "$PARTY_POOL_DEPLOYER" \
--arg partyPoolBPDeployer "$PARTY_POOL_BP_DEPLOYER" \
--arg usxd "$USXD" \
--arg fusd "$FUSD" \
--arg dive "$DIVE" \
--arg butc "$BUTC" \
--arg wteth "$WTETH" \
'
{
v1: {
PartyPlanner: $partyPlanner,
PartyPoolViewer: $partyPoolViewer,
PartyPoolMintImpl: $partyPoolMintImpl,
PartyPoolSwapImpl: $partyPoolSwapImpl,
PartyPoolDeployer: $partyPoolDeployer,
PartyPoolBalancedPairDeployer: $partyPoolBPDeployer,
USXD: $usxd,
FUSD: $fusd,
DIVE: $dive,
BUTC: $butc,
WTETH: $wteth
}
} as $entry |
(try (input | . + {($chainId): $entry}) catch {($chainId): $entry})
' "$METADATA_FILE" 2>/dev/null > "${METADATA_FILE}.tmp" && mv "${METADATA_FILE}.tmp" "$METADATA_FILE" || \
jq -n \
--arg chainId "$CHAINID" \
--arg partyPlanner "$PARTY_PLANNER" \
--arg partyPoolViewer "$PARTY_POOL_VIEWER" \
--arg partyPoolMintImpl "$PARTY_POOL_MINT_IMPL" \
--arg partyPoolSwapImpl "$PARTY_POOL_SWAP_IMPL" \
--arg partyPoolDeployer "$PARTY_POOL_DEPLOYER" \
--arg partyPoolBPDeployer "$PARTY_POOL_BP_DEPLOYER" \
--arg usxd "$USXD" \
--arg fusd "$FUSD" \
--arg dive "$DIVE" \
--arg butc "$BUTC" \
--arg wteth "$WTETH" \
'{($chainId): {
v1: {
PartyPlanner: $partyPlanner,
PartyPoolViewer: $partyPoolViewer,
PartyPoolMintImpl: $partyPoolMintImpl,
PartyPoolSwapImpl: $partyPoolSwapImpl,
PartyPoolDeployer: $partyPoolDeployer,
PartyPoolBalancedPairDeployer: $partyPoolBPDeployer,
USXD: $usxd,
FUSD: $fusd,
DIVE: $dive,
BUTC: $butc,
WTETH: $wteth
}
}}' > "$METADATA_FILE"
echo "Wrote $METADATA_FILE"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,17 +1,17 @@
{
"11155111": {
"v1": {
"PartyPlanner": "0xB2Ce884873E0cA43D27A09b067D019451FDedEcb",
"PartyPoolViewer": "0x19A01c1147ECa796050E87c06983B85B45Cd2fB6",
"PartyPoolMintImpl": "0x616B45855BFD57c17b8B2ced217e675341d8b502",
"PartyPoolSwapImpl": "0x08eF9585F12cA5E37DD595aB1e10E274a4dfa36b",
"PartyPoolDeployer": "0x3aD94c4A4d3976143331c6f3A3E31c5727d2F7C7",
"PartyPoolBalancedPairDeployer": "0xDbCFeB2a145378c6000c3d5b6050f924F366a874",
"USXD": "0x550ea6835BFFe482Cba466B6D4BA282B86Cd8C42",
"FUSD": "0x321EaeF5dFEE696E2167B94279c4ada0A4DD69c0",
"DIVE": "0xf69c252F01d08A1EEBC99a1693aA12a69e882eD1",
"BUTC": "0x61a5D17C14B1B8Fc5aEB910496CF6B7BD7231D7f",
"WTETH": "0x809af9DB37CF5F85265ee4241889c0B136674D4B"
"PartyPlanner": "0x0ad06C08ab5049e6Fd4d7f5AF457115A1475326b",
"PartyPoolViewer": "0x750d63a39a4ccfCfB69D2f5aFDa065909C717cAB",
"PartyPoolMintImpl": "0x25bb10BA84944F8aAEf1fD247C3B7Fe7271C23F9",
"PartyPoolSwapImpl": "0x69b4F102e0747f61F8529b3bbFf2FC4b27438d0F",
"PartyPoolDeployer": "0x0939F93BAa3c96226853F9F39A95beF48eA8fF04",
"PartyPoolBalancedPairDeployer": "0xfda454fF7876aad9408517Ed2F0d11AA229Ad0a4",
"USXD": "0x8E4D16886b8946dfE463fA172129eaBf4825fb09",
"FUSD": "0xdc225280216822CA956738390f589c794129bd53",
"DIVE": "0x7ba123e4e7395A361284d069bD0D545F3f820641",
"BUTC": "0x88125947BBF1A6dd0FeD4B257BB3f9E1FBdCb3Cc",
"WTETH": "0xC8dB65C0B9f4cf59097d4C5Bcb9e8E92B9e4e15F"
}
}
}