Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- Config, docs, scripts, and backup manifests - Submodule refs unchanged (m = modified content in submodules) Made-with: Cursor
89 lines
4.5 KiB
Bash
Executable File
89 lines
4.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Set COMPLIANT_USDT/COMPLIANT_USDC (all c*) and other Chain 138 token addresses in smom-dbis-138/.env,
|
|
# then run RegisterGRUCompliantTokens to register all c* as GRU in UniversalAssetRegistry.
|
|
#
|
|
# Addresses are from docs/11-references/CONTRACT_ADDRESSES_REFERENCE.md and TOKENS_AND_NETWORKS_MINTABLE_TO_DEPLOYER.md.
|
|
# Usage: ./scripts/deployment/set-dotenv-c-tokens-and-register-gru.sh [--no-register]
|
|
# --no-register Only update .env; do not run RegisterGRUCompliantTokens.
|
|
#
|
|
# Note: RegisterGRUCompliantTokens requires (1) broadcast account has REGISTRAR_ROLE, and (2) the
|
|
# UniversalAssetRegistry *implementation* (not just proxy) exposes registerGRUCompliantAsset.
|
|
# Grant REGISTRAR_ROLE (role hash = keccak256("REGISTRAR_ROLE")):
|
|
# REGISTRAR_ROLE=0xedcc084d3dcd65a1f7f23c65c46722faca6953d28e43150a467cf43e5c309238
|
|
# cast send $UNIVERSAL_ASSET_REGISTRY "grantRole(bytes32,address)" $REGISTRAR_ROLE $DEPLOYER --rpc-url $RPC_URL_138 --private-key $PRIVATE_KEY --gas-limit 100000
|
|
# If registration still reverts (empty revert data), the proxy's implementation may be an older
|
|
# version without registerGRUCompliantAsset — upgrade the implementation then re-run.
|
|
|
|
set -euo pipefail
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
SMOM="$PROJECT_ROOT/smom-dbis-138"
|
|
ENV_FILE="$SMOM/.env"
|
|
|
|
RUN_REGISTER=1
|
|
for a in "$@"; do [[ "$a" == "--no-register" ]] && RUN_REGISTER=0; done
|
|
|
|
if [[ ! -f "$ENV_FILE" ]]; then
|
|
echo "Missing $ENV_FILE. Create it first (e.g. copy from .env.example)." >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Set or update a single variable in .env (value must not contain newline or unescaped specials)
|
|
set_env_var() {
|
|
local var="$1" val="$2"
|
|
if grep -q "^${var}=" "$ENV_FILE" 2>/dev/null; then
|
|
sed -i "s|^${var}=.*|${var}=${val}|" "$ENV_FILE"
|
|
else
|
|
echo "${var}=${val}" >> "$ENV_FILE"
|
|
fi
|
|
}
|
|
|
|
echo "=== Setting c* and token addresses in $ENV_FILE (canonical Chain 138) ==="
|
|
|
|
# Canonical compliant tokens (c*) — CONTRACT_ADDRESSES_REFERENCE + TOKENS_AND_NETWORKS
|
|
set_env_var "COMPLIANT_USDT" "0x93E66202A11B1772E55407B32B44e5Cd8eda7f22"
|
|
set_env_var "COMPLIANT_USDC" "0xf22258f57794CC8E06237084b353Ab30fFfa640b"
|
|
set_env_var "CUSDT_ADDRESS_138" "0x93E66202A11B1772E55407B32B44e5Cd8eda7f22"
|
|
set_env_var "CUSDC_ADDRESS_138" "0xf22258f57794CC8E06237084b353Ab30fFfa640b"
|
|
# cEURC (TOKENS_AND_NETWORKS_MINTABLE_TO_DEPLOYER)
|
|
set_env_var "CEURC_ADDRESS_138" "0x8085961F9cF02b4d800A3c6d386D31da4B34266a"
|
|
|
|
# Remaining c* (Chain 138) — from DeployCompliantFiatTokens / ENV_EXAMPLE_CONTENT.md; register as GRU
|
|
set_env_var "CEURT_ADDRESS_138" "0xdf4b71c61E5912712C1Bdd451416B9aC26949d72"
|
|
set_env_var "CGBPC_ADDRESS_138" "0x003960f16D9d34F2e98d62723B6721Fb92074aD2"
|
|
set_env_var "CGBPT_ADDRESS_138" "0x350f54e4D23795f86A9c03988c7135357CCaD97c"
|
|
set_env_var "CAUDC_ADDRESS_138" "0xD51482e567c03899eecE3CAe8a058161FD56069D"
|
|
set_env_var "CJPYC_ADDRESS_138" "0xEe269e1226a334182aace90056EE4ee5Cc8A6770"
|
|
set_env_var "CCHFC_ADDRESS_138" "0x873990849DDa5117d7C644f0aF24370797C03885"
|
|
set_env_var "CCADC_ADDRESS_138" "0x54dBd40cF05e15906A2C21f600937e96787f5679"
|
|
set_env_var "CXAUC_ADDRESS_138" "0x290E52a8819A4fbD0714E517225429aA2B70EC6b"
|
|
set_env_var "CXAUT_ADDRESS_138" "0x94e408E26c6FD8F4ee00b54dF19082FDA07dC96E"
|
|
|
|
# UniversalAssetRegistry (required for GRU registration)
|
|
set_env_var "UNIVERSAL_ASSET_REGISTRY" "0xAEE4b7fBe82E1F8295951584CBc772b8BBD68575"
|
|
|
|
# Other key tokens (Chain 138) — CONTRACT_ADDRESSES_REFERENCE canonical
|
|
set_env_var "WETH9" "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
|
set_env_var "WETH10" "0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f"
|
|
set_env_var "LINK_TOKEN" "0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03"
|
|
set_env_var "CCIP_FEE_TOKEN" "0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03"
|
|
|
|
echo "Done. Set: COMPLIANT_USDT, COMPLIANT_USDC, all C*_ADDRESS_138 (cUSDT, cUSDC, cEURC, cEURT, cGBPC, cGBPT, cAUDC, cJPYC, cCHFC, cCADC, cXAUC, cXAUT), UNIVERSAL_ASSET_REGISTRY, WETH9, WETH10, LINK_TOKEN, CCIP_FEE_TOKEN."
|
|
echo "All c* on explorer.d-bis.org/tokens must be GRU-registered. See docs/04-configuration/EXPLORER_TOKENS_GRU_POLICY.md."
|
|
|
|
if [[ "$RUN_REGISTER" -eq 0 ]]; then
|
|
echo "Skipping GRU registration (--no-register)."
|
|
exit 0
|
|
fi
|
|
|
|
echo ""
|
|
echo "=== Registering all c* as GRU (RegisterGRUCompliantTokens) ==="
|
|
set -a
|
|
source "$ENV_FILE"
|
|
set +a
|
|
RPC="${RPC_URL_138:-http://192.168.11.211:8545}"
|
|
export RPC_URL_138="$RPC"
|
|
(cd "$SMOM" && forge script script/deploy/RegisterGRUCompliantTokens.s.sol \
|
|
--rpc-url "$RPC_URL_138" --broadcast --private-key "$PRIVATE_KEY" --with-gas-price 1000000000)
|
|
echo "=== Done. ==="
|