Files
smom-dbis-138/docs/deployment/FOUNDRY_CONFIG_FIX.md
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

138 lines
2.9 KiB
Markdown

# Foundry Configuration Fix
**Date**: 2025-12-11
**Issue**: Warnings about unknown `etherscan` and `rpc_url` config in profiles
---
## ❌ Problem
Foundry was showing warnings:
```
Warning: Found unknown `etherscan` config for profile `mainnet` defined in foundry.toml.
Warning: Found unknown `rpc_url` config for profile `mainnet` defined in foundry.toml.
```
These warnings appeared for all network profiles (mainnet, cronos, bsc, polygon, gnosis, avalanche, base, arbitrum, optimism).
---
## ✅ Solution
Foundry profiles don't support `rpc_url` and `etherscan` as direct keys. These configurations should be referenced via command-line flags instead.
**Removed**: Profile sections with `rpc_url` and `etherscan` keys
**Kept**: `[rpc_endpoints]` and `[etherscan]` sections (these are correct)
---
## 📋 Correct Usage
### RPC Endpoints
Reference RPC endpoints by name from the `[rpc_endpoints]` section:
```bash
# Use mainnet RPC
forge script ... --rpc-url mainnet
# Use polygon RPC
forge script ... --rpc-url polygon
```
### Etherscan API Keys
Reference etherscan configs by name and pass the API key:
```bash
# For mainnet
forge verify-contract ... --etherscan-api-key $ETHERSCAN_API_KEY
# For polygon
forge verify-contract ... --etherscan-api-key $POLYGONSCAN_API_KEY
```
Or use the `--chain` flag with the etherscan config name:
```bash
forge verify-contract ... --chain polygon --etherscan-api-key $POLYGONSCAN_API_KEY
```
---
## 🔧 Configuration Structure
### Correct `foundry.toml` Structure
```toml
[rpc_endpoints]
mainnet = "${ETHEREUM_MAINNET_RPC}"
polygon = "${POLYGON_RPC_URL}"
# ... etc
[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}" }
polygon = { key = "${POLYGONSCAN_API_KEY}", chain = "polygon" }
# ... etc
# Profiles should NOT contain rpc_url or etherscan keys
[profile.default]
# ... compiler settings
```
### Removed Profile Sections
The following profile sections were removed (they caused warnings):
```toml
# ❌ REMOVED - Not supported by Foundry
[profile.mainnet]
rpc_url = "mainnet"
etherscan = "mainnet"
chain_id = 1
```
---
## 📝 Chain IDs Reference
For reference when using `--chain-id` flag:
- **mainnet**: 1
- **cronos**: 25
- **bsc**: 56
- **polygon**: 137
- **gnosis**: 100
- **avalanche**: 43114
- **base**: 8453
- **arbitrum**: 42161
- **optimism**: 10
---
## ✅ Verification
After the fix, Foundry commands should run without warnings:
```bash
# Should show no warnings
forge script script/DeployMainnetTether.s.sol --rpc-url mainnet --dry-run
# Should show no warnings
forge verify-contract ... --etherscan-api-key $ETHERSCAN_API_KEY
```
---
## 📚 Additional Resources
- [Foundry Book - Configuration](https://book.getfoundry.sh/reference/config)
- [Foundry Book - Scripts](https://book.getfoundry.sh/reference/forge/forge-script)
- [Foundry Book - Verify](https://book.getfoundry.sh/reference/forge/forge-verify-contract)
---
**Last Updated**: 2025-12-11
**Status**: ✅ Fixed