# Deployed Smart Contracts Inventory

**Date**: $(date)  
**Status**: ⚠️ **NO CONTRACTS DEPLOYED YET** - All addresses are placeholders  
**Chain ID**: 138

---

## 🔍 Search Results Summary

After searching through all documentation and configuration files, **no deployed smart contract addresses were found**. All references to contract addresses are either:
- Empty placeholders in configuration templates
- Placeholder values like `<contract-address>` or `<deploy-contract-first>`
- Configuration variables that need to be set after deployment

---

## 📋 Required Smart Contracts

### 1. Oracle Contracts

#### Oracle Publisher Contract
**Status**: ⏳ Not Deployed  
**Required By**: Oracle Publisher Service (VMID 3500)

**Configuration Location**:
- `/opt/oracle-publisher/.env`
- Template: `smom-dbis-138-proxmox/install/oracle-publisher-install.sh`

**Expected Configuration**:
```bash
ORACLE_CONTRACT_ADDRESS=  # Currently empty - needs deployment
```

**Contract Purpose**:
- Receive price feed updates from Oracle Publisher service
- Store aggregated price data
- Provide price data to consumers

---

### 2. CCIP (Cross-Chain Interoperability Protocol) Contracts

#### CCIP Router Contract
**Status**: ⏳ Not Deployed  
**Required By**: CCIP Monitor Service (VMID 3501)

**Configuration Location**:
- `/opt/ccip-monitor/.env`
- Template: `smom-dbis-138-proxmox/install/ccip-monitor-install.sh`

**Expected Configuration**:
```bash
CCIP_ROUTER_ADDRESS=  # Currently empty - needs deployment
```

**Contract Purpose**:
- Main CCIP router contract for cross-chain message routing
- Handles message commitment and execution
- Manages cross-chain message flow

#### CCIP Sender Contract
**Status**: ⏳ Not Deployed  
**Required By**: CCIP Monitor Service (VMID 3501)

**Expected Configuration**:
```bash
CCIP_SENDER_ADDRESS=  # Currently empty - needs deployment
```

**Contract Purpose**:
- Sender contract for initiating CCIP messages
- Handles message preparation and submission

#### LINK Token Contract
**Status**: ⏳ Not Deployed  
**Required By**: CCIP Monitor Service (VMID 3501)

**Expected Configuration**:
```bash
LINK_TOKEN_ADDRESS=  # Currently empty - needs deployment
```

**Contract Purpose**:
- LINK token contract on Chain 138
- Used for CCIP fee payments
- Token transfers for CCIP operations

---

### 3. Keeper Contracts

#### Price Feed Keeper Contract
**Status**: ⏳ Not Deployed  
**Required By**: Price Feed Keeper Service (VMID 3502)

**Configuration Location**:
- `/opt/keeper/.env`
- Template: `smom-dbis-138-proxmox/install/keeper-install.sh`

**Expected Configuration**:
```bash
PRICE_FEED_KEEPER_ADDRESS=  # Currently empty - needs deployment
KEEPER_CONTRACT_ADDRESS=    # Alternative name used in some configs
```

**Contract Purpose**:
- Automation contract for triggering price feed updates
- Checks if upkeep is needed
- Executes upkeep transactions

---

### 4. Tokenization Contracts

#### Financial Tokenization Contract
**Status**: ⏳ Not Deployed  
**Required By**: Financial Tokenization Service (VMID 3503)

**Configuration Location**:
- `/opt/financial-tokenization/.env`
- Template: `smom-dbis-138-proxmox/install/financial-tokenization-install.sh`

**Expected Configuration**:
```bash
TOKENIZATION_CONTRACT_ADDRESS=  # Currently empty - needs deployment
```

**Contract Purpose**:
- Tokenization of financial instruments
- ERC-20/ERC-721 token management
- Asset tokenization operations

---

### 5. Hyperledger Firefly Contracts

#### Firefly Core Contracts
**Status**: ⏳ Not Deployed (Auto-deployed by Firefly)  
**Required By**: Hyperledger Firefly (VMID 6200)

**Configuration Location**:
- `/opt/firefly/docker-compose.yml`

**Note**: Firefly automatically deploys its own contracts on first startup. No manual deployment needed, but contract addresses will be generated.

**Contract Purpose**:
- Firefly core functionality
- Tokenization APIs
- Multi-party workflows
- Event streaming

---

## 📝 Configuration Templates Found

### 1. Oracle Publisher Configuration Template

**File**: `smom-dbis-138-proxmox/install/oracle-publisher-install.sh` (lines 73-95)

```bash
# Oracle Publisher Configuration
RPC_URL_138=http://10.3.1.40:8545  # Note: Should be updated to 192.168.11.250
ORACLE_CONTRACT_ADDRESS=            # EMPTY - needs deployment
PRIVATE_KEY=                         # EMPTY - needs configuration
UPDATE_INTERVAL=30
HEARTBEAT_INTERVAL=300
DEVIATION_THRESHOLD=0.01

# Data Sources
DATA_SOURCE_1_URL=
DATA_SOURCE_1_PARSER=
DATA_SOURCE_2_URL=
DATA_SOURCE_2_PARSER=

# Metrics
METRICS_PORT=8000
METRICS_ENABLED=true
```

---

### 2. CCIP Monitor Configuration Template

**File**: `smom-dbis-138-proxmox/install/ccip-monitor-install.sh` (lines 71-86)

```bash
# CCIP Monitor Configuration
RPC_URL_138=http://10.3.1.40:8545  # Note: Should be updated to 192.168.11.250
CCIP_ROUTER_ADDRESS=                 # EMPTY - needs deployment
CCIP_SENDER_ADDRESS=                 # EMPTY - needs deployment
LINK_TOKEN_ADDRESS=                  # EMPTY - needs deployment

# Monitoring
METRICS_PORT=8000
CHECK_INTERVAL=60
ALERT_WEBHOOK=

# OpenTelemetry (optional)
OTEL_ENABLED=false
OTEL_ENDPOINT=http://localhost:4317
```

---

### 3. Keeper Configuration Template

**File**: `smom-dbis-138-proxmox/install/keeper-install.sh` (lines 69-78)

```bash
# Price Feed Keeper Configuration
RPC_URL_138=http://10.3.1.40:8545  # Note: Should be updated to 192.168.11.250
KEEPER_PRIVATE_KEY=                  # EMPTY - needs configuration
PRICE_FEED_KEEPER_ADDRESS=          # EMPTY - needs deployment
UPDATE_INTERVAL=30

# Health check
HEALTH_PORT=3000
```

---

### 4. Financial Tokenization Configuration Template

**File**: `smom-dbis-138-proxmox/install/financial-tokenization-install.sh` (lines 69-79)

```bash
# Financial Tokenization Configuration
FIREFLY_API_URL=http://10.3.1.60:5000  # Note: Should be updated to 192.168.11.66
FIREFLY_API_KEY=                        # EMPTY - needs configuration
BESU_RPC_URL=http://10.3.1.40:8545      # Note: Should be updated to 192.168.11.250
CHAIN_ID=138

# Flask
FLASK_ENV=production
FLASK_PORT=5001
```

**Note**: This service uses Firefly API rather than direct contract interaction, but may still need tokenization contract addresses.

---

## 🔍 Files Searched

### Documentation Files
- ✅ `docs/SMART_CONTRACT_CONNECTIONS_AND_NEXT_LXCS.md`
- ✅ `docs/07-ccip/CCIP_DEPLOYMENT_SPEC.md`
- ✅ `smom-dbis-138-proxmox/docs/SERVICES_LIST.md`
- ✅ `smom-dbis-138-proxmox/COMPLETE_SERVICES_LIST.md`
- ✅ `smom-dbis-138-proxmox/ONE_COMMAND_DEPLOYMENT.md`
- ✅ `docs/06-besu/COMPREHENSIVE_CONSISTENCY_REVIEW.md`

### Installation Scripts (Configuration Templates)
- ✅ `smom-dbis-138-proxmox/install/oracle-publisher-install.sh`
- ✅ `smom-dbis-138-proxmox/install/ccip-monitor-install.sh`
- ✅ `smom-dbis-138-proxmox/install/keeper-install.sh`
- ✅ `smom-dbis-138-proxmox/install/financial-tokenization-install.sh`
- ✅ `smom-dbis-138-proxmox/install/firefly-install.sh`
- ✅ `smom-dbis-138-proxmox/install/cacti-install.sh`

### Configuration Files
- ✅ `smom-dbis-138-proxmox/config/proxmox.conf`
- ✅ `smom-dbis-138-proxmox/config/network.conf`
- ✅ `smom-dbis-138-proxmox/config/genesis.json` (contains validator addresses, not contract addresses)

### Search Patterns Used
- ✅ `contract.*address|CONTRACT.*ADDRESS`
- ✅ `0x[a-fA-F0-9]{40}` (Ethereum addresses)
- ✅ `ORACLE|CCIP|KEEPER|ROUTER|TOKEN|LINK`
- ✅ `deploy.*contract|contract.*deployed`
- ✅ `.env` files

---

## ⚠️ Key Findings

### 1. No Contracts Deployed
- **All contract address fields are empty** in configuration templates
- No deployment scripts found that deploy contracts
- No deployment logs or records found
- No contract addresses documented anywhere

### 2. Configuration Templates Exist
- Installation scripts create `.env.template` files
- Templates show expected configuration structure
- All contract addresses are placeholders

### 3. IP Address Inconsistencies
- Many templates still reference old IP range `10.3.1.40`
- Should be updated to `192.168.11.250` (current RPC endpoint)
- Found in:
  - Oracle Publisher: `RPC_URL_138=http://10.3.1.40:8545`
  - CCIP Monitor: `RPC_URL_138=http://10.3.1.40:8545`
  - Keeper: `RPC_URL_138=http://10.3.1.40:8545`
  - Financial Tokenization: `BESU_RPC_URL=http://10.3.1.40:8545`

### 4. Deployment Script Reference
- Found reference to `scripts/deployment/deploy-contracts-once-ready.sh` in consistency review
- This script is mentioned but not found in current codebase
- May need to be created or located in source project (`/home/intlc/projects/smom-dbis-138`)

---

## 📋 Next Steps

### 1. Deploy Smart Contracts

Contracts need to be deployed before services can be configured. Deployment order:

1. **Oracle Contract** (for Oracle Publisher)
2. **LINK Token Contract** (for CCIP)
3. **CCIP Router Contract** (for CCIP)
4. **CCIP Sender Contract** (for CCIP)
5. **Keeper Contract** (for Price Feed Keeper)
6. **Tokenization Contracts** (for Financial Tokenization)

### 2. Update Configuration Files

After deployment, update service configurations:

```bash
# Oracle Publisher
pct exec 3500 -- bash -c "cat > /opt/oracle-publisher/.env <<EOF
RPC_URL_138=http://192.168.11.250:8545
ORACLE_CONTRACT_ADDRESS=<deployed-oracle-address>
PRIVATE_KEY=<oracle-private-key>
...
EOF"

# CCIP Monitor
pct exec 3501 -- bash -c "cat > /opt/ccip-monitor/.env <<EOF
RPC_URL_138=http://192.168.11.250:8545
CCIP_ROUTER_ADDRESS=<deployed-router-address>
CCIP_SENDER_ADDRESS=<deployed-sender-address>
LINK_TOKEN_ADDRESS=<deployed-link-address>
...
EOF"

# Keeper
pct exec 3502 -- bash -c "cat > /opt/keeper/.env <<EOF
RPC_URL_138=http://192.168.11.250:8545
PRICE_FEED_KEEPER_ADDRESS=<deployed-keeper-address>
KEEPER_PRIVATE_KEY=<keeper-private-key>
...
EOF"
```

### 3. Check Source Project ✅

The source project (`/home/intlc/projects/smom-dbis-138`) has been checked. **See**: [Source Project Contract Deployment Info](./SOURCE_PROJECT_CONTRACT_DEPLOYMENT_INFO.md)

**Key Findings**:
- ✅ All deployment scripts exist and are ready
- ✅ Contracts deployed to 6 other chains (BSC, Polygon, etc.)
- ❌ **No contracts deployed to Chain 138 yet**
- ✅ Chain 138 specific deployment scripts available
- ✅ Deployment automation script ready (needs IP update)

**Action**: Deploy contracts using scripts in source project.

---

## 📊 Summary Table

| Contract Type | Status | Required By | Config Location | Address Found |
|---------------|--------|------------|----------------|---------------|
| Oracle Contract | ⏳ Not Deployed | Oracle Publisher (3500) | `/opt/oracle-publisher/.env` | ❌ No |
| CCIP Router | ⏳ Not Deployed | CCIP Monitor (3501) | `/opt/ccip-monitor/.env` | ❌ No |
| CCIP Sender | ⏳ Not Deployed | CCIP Monitor (3501) | `/opt/ccip-monitor/.env` | ❌ No |
| LINK Token | ⏳ Not Deployed | CCIP Monitor (3501) | `/opt/ccip-monitor/.env` | ❌ No |
| Keeper Contract | ⏳ Not Deployed | Keeper (3502) | `/opt/keeper/.env` | ❌ No |
| Tokenization Contract | ⏳ Not Deployed | Financial Tokenization (3503) | `/opt/financial-tokenization/.env` | ❌ No |
| Firefly Contracts | ⏳ Auto-deploy | Firefly (6200) | Auto-deployed | ❌ N/A |

---

## 🔗 Related Documentation

- [Smart Contract Connections & Next LXCs](./SMART_CONTRACT_CONNECTIONS_AND_NEXT_LXCS.md) - Connection requirements
- [CCIP Deployment Spec](./07-ccip/CCIP_DEPLOYMENT_SPEC.md) - CCIP infrastructure
- [Services List](../smom-dbis-138-proxmox/docs/SERVICES_LIST.md) - Service details

---

**Conclusion**: No smart contracts have been deployed yet. All configuration templates contain empty placeholders for contract addresses. Contracts need to be deployed before services can be configured and started.

