- 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.
3.5 KiB
3.5 KiB
WETH Deployment Methods
Current Deployment Status
WETH9 Deployment
- Current Method: Standard
new WETH()(CREATE opcode) - Address: Non-deterministic (depends on deployer nonce)
- Ethereum Mainnet Address:
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
WETH10 Deployment
- Current Method: Standard
new WETH10()(CREATE opcode) - Address: Non-deterministic (depends on deployer nonce)
- Ethereum Mainnet Address:
0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f
Can We Match Ethereum Mainnet Addresses?
WETH9: ❌ NO
Reason: WETH9 on Ethereum Mainnet was deployed using the CREATE opcode (not CREATE2). The address was determined by:
- Deployer address
- Deployer nonce (transaction count)
Since the nonce is chain-specific, it's impossible to replicate the exact Ethereum Mainnet address on ChainID 138.
WETH10: ⚠️ POSSIBLY
Reason: WETH10 may have been deployed with CREATE2. To match the address, we need:
- Exact same bytecode (must match byte-for-byte)
- Same deployer address (or factory address)
- Same salt (if deployed with CREATE2)
If WETH10 on Ethereum Mainnet was deployed with CREATE2, we can match the address by:
- Using the same bytecode
- Using the same CREATE2Factory address (or deploying from the same address)
- Using the same salt
CREATE2 Deployment Scripts
We've created CREATE2 deployment scripts:
-
script/DeployWETHWithCREATE2.s.sol- Deploys WETH9 using CREATE2
- Creates a new deterministic address for ChainID 138
- Will NOT match Ethereum Mainnet (since Mainnet used CREATE)
-
script/DeployWETH10WithCREATE2.s.sol- Deploys WETH10 using CREATE2
- Attempts to match Ethereum Mainnet address
- Will match if WETH10 on Mainnet was deployed with CREATE2 and we use the same parameters
Usage
Deploy WETH9 with CREATE2 (New Deterministic Address)
forge script script/DeployWETHWithCREATE2.s.sol:DeployWETHWithCREATE2 \
--rpc-url $RPC_URL \
--broadcast \
--private-key $PRIVATE_KEY
Deploy WETH10 with CREATE2 (Attempt to Match Mainnet)
forge script script/DeployWETH10WithCREATE2.s.sol:DeployWETH10WithCREATE2 \
--rpc-url $RPC_URL \
--broadcast \
--private-key $PRIVATE_KEY
Benefits of CREATE2
- Deterministic Addresses: Same address across deployments if parameters match
- Predictable: Can compute address before deployment
- Cross-Chain Compatibility: Same address on different chains if parameters match
- Upgrade Safety: Can deploy new version to same address after self-destruct
Important Notes
- WETH9 on Ethereum Mainnet: Cannot be replicated (was CREATE, not CREATE2)
- WETH10 on Ethereum Mainnet: May be replicable if deployed with CREATE2
- Bytecode Must Match: For address matching, bytecode must be identical
- Salt Must Match: If using CREATE2, the salt must be the same
- Deployer Must Match: The deployer address (or factory) must be the same
Recommendation
For ChainID 138, we recommend:
- Option 1: Use CREATE2 for deterministic addresses (new addresses, but predictable)
- Option 2: Use standard CREATE (current method) for simplicity
- Option 3: If WETH10 was deployed with CREATE2 on Mainnet, attempt to match the address
The choice depends on whether you need:
- Address matching with Mainnet: Only possible for WETH10 if it was deployed with CREATE2
- Deterministic addresses: Use CREATE2 with known salt
- Simplicity: Use standard CREATE (current method)