# Complete Remaining Deployment

**Date**: 2025-12-24  
**Status**: 3/5 Complete - 2 Remaining

---

## ✅ Already Deployed

1. ComplianceRegistry: `0xf52504A9c0DAFB0a35dEE0129D6991AA27E734c8`
2. CompliantUSDT: `0xFe6023265F3893C4cc98CE5Fe7ACBd79DB9cbB2D`
3. CompliantUSDC: `0x044032f30393c60138445061c941e2FB15fb0af2`

---

## 🚀 Deploy Remaining Contracts

### Step 1: Deploy TokenRegistry (with --via-ir)

```bash
cd /home/intlc/projects/proxmox/smom-dbis-138
source .env

forge script script/DeployTokenRegistry.s.sol:DeployTokenRegistry \
  --rpc-url $RPC_URL \
  --broadcast \
  --legacy \
  --gas-price 20000000000 \
  --via-ir \
  -vv
```

**Save the deployed address** from output.

### Step 2: Deploy FeeCollector (with --via-ir)

```bash
cd /home/intlc/projects/proxmox/smom-dbis-138
source .env

forge script script/DeployFeeCollector.s.sol:DeployFeeCollector \
  --rpc-url $RPC_URL \
  --broadcast \
  --legacy \
  --gas-price 20000000000 \
  --via-ir \
  -vv
```

**Save the deployed address** from output.

---

## 🔗 Register Contracts

After both are deployed, register them:

### Register in ComplianceRegistry

```bash
cd /home/intlc/projects/proxmox/smom-dbis-138
source .env

# Set addresses (replace with actual from deployment)
COMPLIANCE_REGISTRY=0xf52504A9c0DAFB0a35dEE0129D6991AA27E734c8
COMPLIANT_USDT=0xFe6023265F3893C4cc98CE5Fe7ACBd79DB9cbB2D
COMPLIANT_USDC=0x044032f30393c60138445061c941e2FB15fb0af2

# Register CompliantUSDT
cast send $COMPLIANCE_REGISTRY \
  "registerContract(address)" \
  $COMPLIANT_USDT \
  --rpc-url $RPC_URL \
  --private-key $PRIVATE_KEY \
  --legacy \
  --gas-price 20000000000

# Register CompliantUSDC
cast send $COMPLIANCE_REGISTRY \
  "registerContract(address)" \
  $COMPLIANT_USDC \
  --rpc-url $RPC_URL \
  --private-key $PRIVATE_KEY \
  --legacy \
  --gas-price 20000000000
```

### Register in TokenRegistry

```bash
cd /home/intlc/projects/proxmox/smom-dbis-138
source .env

# Set TokenRegistry address (from Step 1)
TOKEN_REGISTRY=0x...  # Replace with actual address

# Register CompliantUSDT
cast send $TOKEN_REGISTRY \
  "registerToken(address,string,string,uint8,bool,address)" \
  $COMPLIANT_USDT \
  "Tether USD (Compliant)" \
  "cUSDT" \
  6 \
  false \
  0x0000000000000000000000000000000000000000 \
  --rpc-url $RPC_URL \
  --private-key $PRIVATE_KEY \
  --legacy \
  --gas-price 20000000000

# Register CompliantUSDC
cast send $TOKEN_REGISTRY \
  "registerToken(address,string,string,uint8,bool,address)" \
  $COMPLIANT_USDC \
  "USD Coin (Compliant)" \
  "cUSDC" \
  6 \
  false \
  0x0000000000000000000000000000000000000000 \
  --rpc-url $RPC_URL \
  --private-key $PRIVATE_KEY \
  --legacy \
  --gas-price 20000000000
```

---

## ✅ Verify All Deployments

```bash
cd /home/intlc/projects/proxmox/smom-dbis-138
source .env

# Check all contracts have code
cast code $COMPLIANCE_REGISTRY_ADDRESS --rpc-url $RPC_URL
cast code $COMPLIANT_USDT_ADDRESS --rpc-url $RPC_URL
cast code $COMPLIANT_USDC_ADDRESS --rpc-url $RPC_URL
cast code $TOKEN_REGISTRY_ADDRESS --rpc-url $RPC_URL
cast code $FEE_COLLECTOR_ADDRESS --rpc-url $RPC_URL
```

Each should return bytecode (not empty).

---

**Key Fix**: Use `--via-ir` flag for TokenRegistry and FeeCollector deployments!

