#!/bin/sh -e

# Simple script that builds and deploys the contracts for testnet.

if [ -z "$SPN_SUPERPOSITION_KEY" ]; then
	>&2 echo "SPN_SUPERPOSITION_KEY unset"
	exit 1
fi

./build-testnet.sh

export \
	SPN_TRADING_DPPM_EXTRAS_IMPL_ADDR=0x0000000000000000000000000000000000000000 \
	SPN_TRADING_DPPM_MINT_IMPL_ADDR=0x0000000000000000000000000000000000000000 \
	SPN_TRADING_DPPM_QUOTES_IMPL_ADDR=0x0000000000000000000000000000000000000000 \
	SPN_TRADING_DPPM_PRICE_IMPL_ADDR=0x0000000000000000000000000000000000000000 \
	SPN_SUPERPOSITION_URL=https://testnet-rpc.superposition.so \
	SPN_EMERGENCY_COUNCIL=0xfeb6034fc7df27df18a3a6bad5fb94c0d3dcb6d5 \
	SPN_LONGTAIL_ADDR=0x0000000000000000000000000000000000000000 \
	SPN_FUSDC_ADDR=0xA8EA92c819463EFbEdDFB670FEfC881A480f0115 \
	SPN_SARP_AI=0x0000000000000000000000000000000000000000 \
	SPN_CAMELOT_SWAP_ROUTER=0x0000000000000000000000000000000000000000 \
	SPN_STARGATE_ADDR=0x0000000000000000000000000000000000000000 \
	SPN_PAYMASTER_CALLER_ADDR=0x0000000000000000000000000000000000000000 \
	SPN_WETH_ADDR=0x22b9fa698b68bBA071B513959794E9a47d19214c

export \
	SPN_PROXY_ADMIN=$SPN_EMERGENCY_COUNCIL

./deploy.sh
