mint & burn streamlining

This commit is contained in:
tim
2025-12-01 17:05:05 -04:00
parent 6795886eab
commit c2dd33bfac
53 changed files with 111 additions and 110 deletions

View File

@@ -70,14 +70,15 @@ token() {
echo "$addr"
}
PARTY_POOL_MINT_IMPL=$(contract PartyPoolMintImpl)
PARTY_POOL_SWAP_IMPL=$(contract PartyPoolSwapImpl)
PARTY_INFO=$(contract PartyInfo)
PARTY_POOL_INIT_CODE=$(contractByIndex 3)
PARTY_POOL_INIT_CODE_BP=$(contractByIndex 4)
PARTY_PLANNER=$(contract PartyPlanner)
if [ "$1" == "broadcast" ] || [ "$1" == "record" ]; then
PARTY_POOL_MINT_IMPL=$(contract PartyPoolMintImpl)
PARTY_POOL_SWAP_IMPL=$(contract PartyPoolSwapImpl)
PARTY_INFO=$(contract PartyInfo)
PARTY_POOL_INIT_CODE=$(contractByIndex 3)
PARTY_POOL_INIT_CODE_BP=$(contractByIndex 4)
PARTY_PLANNER=$(contract PartyPlanner)
OUT=deployment/$CHAINID/v1
git rm -rf $OUT > /dev/null 2>&1
mkdir -p $OUT

View File

@@ -69,59 +69,27 @@ token() {
echo "$addr"
}
PARTY_PLANNER=$(contract PartyPlanner)
PARTY_INFO=$(contract PartyInfo)
PARTY_POOL_MINT_IMPL=$(contract PartyPoolMintImpl)
PARTY_POOL_SWAP_IMPL=$(contract PartyPoolSwapImpl)
PARTY_POOL_INIT_CODE=$(contract PartyPoolInitCode)
PARTY_POOL_INIT_CODE_BP=$(contract PartyPoolBalancedPairInitCode)
USXD=$(token USXD)
FUSD=$(token FUSD)
DIVE=$(token DIVE)
BUTC=$(token BUTC)
WTETH=$(token WTETH)
if [ "$1" == "broadcast" ] || [ "$1" == "record" ]; then
PARTY_PLANNER=$(contract PartyPlanner)
PARTY_INFO=$(contract PartyInfo)
PARTY_POOL_MINT_IMPL=$(contract PartyPoolMintImpl)
PARTY_POOL_SWAP_IMPL=$(contract PartyPoolSwapImpl)
PARTY_POOL_INIT_CODE=$(contract PartyPoolInitCode)
PARTY_POOL_INIT_CODE_BP=$(contract PartyPoolBalancedPairInitCode)
USXD=$(token USXD)
FUSD=$(token FUSD)
DIVE=$(token DIVE)
BUTC=$(token BUTC)
WTETH=$(token WTETH)
OUT=deployment/$CHAINID/v1
git rm -rf $OUT > /dev/null 2>&1
mkdir -p $OUT
cp -r out $OUT/ > /dev/null 2>&1
git add $OUT/out > /dev/null 2>&1
fi
# Build and insert the JSON object directly in jq
jq -n \
--arg chainId "$CHAINID" \
--arg partyPlanner "$PARTY_PLANNER" \
--arg partyInfo "$PARTY_INFO" \
--arg partyPoolMintImpl "$PARTY_POOL_MINT_IMPL" \
--arg partyPoolSwapImpl "$PARTY_POOL_SWAP_IMPL" \
--arg partyPoolInitCode "$PARTY_POOL_INIT_CODE" \
--arg partyPoolInitCodeBP "$PARTY_POOL_INIT_CODE_BP" \
--arg usxd "$USXD" \
--arg fusd "$FUSD" \
--arg dive "$DIVE" \
--arg butc "$BUTC" \
--arg wteth "$WTETH" \
'
{
v1: {
PartyPlanner: $partyPlanner,
PartyInfo: $partyInfo,
PartyPoolMintImpl: $partyPoolMintImpl,
PartyPoolSwapImpl: $partyPoolSwapImpl,
PartyPoolInitCode: $partyPoolInitCode,
PartyPoolBalancedPairInitCode: $partyPoolInitCodeBP,
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" || \
# Build and insert the JSON object directly in jq
jq -n \
--arg chainId "$CHAINID" \
--arg partyPlanner "$PARTY_PLANNER" \
@@ -135,7 +103,8 @@ jq -n \
--arg dive "$DIVE" \
--arg butc "$BUTC" \
--arg wteth "$WTETH" \
'{($chainId): {
'
{
v1: {
PartyPlanner: $partyPlanner,
PartyInfo: $partyInfo,
@@ -149,6 +118,37 @@ jq -n \
BUTC: $butc,
WTETH: $wteth
}
}}' > "$METADATA_FILE"
} 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 partyInfo "$PARTY_INFO" \
--arg partyPoolMintImpl "$PARTY_POOL_MINT_IMPL" \
--arg partyPoolSwapImpl "$PARTY_POOL_SWAP_IMPL" \
--arg partyPoolInitCode "$PARTY_POOL_INIT_CODE" \
--arg partyPoolInitCodeBP "$PARTY_POOL_INIT_CODE_BP" \
--arg usxd "$USXD" \
--arg fusd "$FUSD" \
--arg dive "$DIVE" \
--arg butc "$BUTC" \
--arg wteth "$WTETH" \
'{($chainId): {
v1: {
PartyPlanner: $partyPlanner,
PartyInfo: $partyInfo,
PartyPoolMintImpl: $partyPoolMintImpl,
PartyPoolSwapImpl: $partyPoolSwapImpl,
PartyPoolInitCode: $partyPoolInitCode,
PartyPoolBalancedPairInitCode: $partyPoolInitCodeBP,
USXD: $usxd,
FUSD: $fusd,
DIVE: $dive,
BUTC: $butc,
WTETH: $wteth
}
}}' > "$METADATA_FILE"
echo "Wrote $METADATA_FILE"
echo "Wrote $METADATA_FILE"
fi