fix: pass LM_ADDRESS and POOL_ADDRESS to ponder env (#4) #5
2 changed files with 14 additions and 0 deletions
|
|
@ -104,6 +104,8 @@ write_ponder_env() {
|
|||
PONDER_NETWORK=$NETWORK_NAME
|
||||
KRAIKEN_ADDRESS=$KRAIKEN
|
||||
STAKE_ADDRESS=$STAKE
|
||||
LM_ADDRESS=$LIQUIDITY_MANAGER
|
||||
POOL_ADDRESS=$POOL_ADDRESS
|
||||
START_BLOCK=$DEPLOY_BLOCK
|
||||
PONDER_RPC_URL_${NETWORK_NAME}=$ANVIL_RPC
|
||||
DATABASE_URL=postgresql://ponder:ponder_local@postgres:5432/ponder_local
|
||||
|
|
|
|||
|
|
@ -102,6 +102,18 @@ extract_addresses() {
|
|||
bootstrap_log "LiquidityManager address missing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Discover Uniswap pool address from factory
|
||||
detect_swap_router
|
||||
local factory
|
||||
factory=$(cast call --rpc-url "$ANVIL_RPC" "$SWAP_ROUTER" "factory()(address)" 2>/dev/null) || factory=""
|
||||
if [[ -n "$factory" && "$factory" != "0x" ]]; then
|
||||
POOL_ADDRESS=$(cast call --rpc-url "$ANVIL_RPC" "$factory" "getPool(address,address,uint24)(address)" "$WETH" "$KRAIKEN" 10000 2>/dev/null) || POOL_ADDRESS=""
|
||||
fi
|
||||
if [[ -z "$POOL_ADDRESS" || "$POOL_ADDRESS" == "0x0000000000000000000000000000000000000000" ]]; then
|
||||
bootstrap_log "Warning: could not discover pool address"
|
||||
POOL_ADDRESS=""
|
||||
fi
|
||||
}
|
||||
|
||||
write_contracts_env() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue