Bridge USDC to your OP Stack Rollup
This guide will show you how to manually bridge USDC to your rollup using Foundry CLI commands.
Depositing
On the settlement layer, execute the following steps to bridge USDC to your rollup:
Locate Bridge Contracts
In the Conduit UI, navigate to the Apps
section. Click on Your Apps
and select Bridged USDC
. You’ll find the Installation Details
in the bottom-right corner, including contract addresses for:
Bridged USDC (Rollup)
USDC (Settlement Layer)
Bridge (Rollup)
Bridge (Settlement Layer)
Rollup Factory (Rollup)
Export these addresses as environment variables:
export ROLLUP_USDC_TOKEN_ADDRESS=<Bridged USDC>
export ROLLUP_USDC_BRIDGE_ADDRESS=<Bridge (Rollup)>
export SETTLEMENT_USDC_BRIDGE_ADDRESS=<Bridge (Settlement Layer)>
Settlement Layer USDC Addresses & Settlement RPC URL
Pick your settlement layer and export the Settlement USDC Token Address and the RPC URL as environment variables:
Settlement Layer | SETTLEMENT_USDC_TOKEN_ADDRESS |
---|---|
Ethereum Mainnet | 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 |
Sepolia Testnet | 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 |
Arbitrum | 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 |
Arbitrum Sepolia | 0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d |
Base | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
Base Sepolia | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
export SETTLEMENT_USDC_TOKEN_ADDRESS=0x....
export SETTLEMENT_RPC_URL=https://...
Configure Foundry with your wallet
We need to sign the transactions with a private key. Refer to Foundry’s Key Management Best Practices for production use.
The following steps will utilize the --private-key
flag and the $PRIVATE_KEY
environment variable. Set the environment variable with the following command:
export PRIVATE_KEY=...
If you’re using a different method, replace --private-key $PRIVATE_KEY
with the appropriate flag in the commands below.
Fund your wallet
Make sure your wallet is funded with the native token and USDC on the settlement layer. If you are bridging onto a Testnet you can claim some testnet USDC here: Circle Testnet Faucet.
Approve
Set the amount you want to bridge
export AMOUNT=100
Approve the Optimism bridge contract on the settlement layer to transfer your USDC:
cast send $SETTLEMENT_USDC_TOKEN_ADDRESS "approve(address,uint256)" $SETTLEMENT_USDC_BRIDGE_ADDRESS $AMOUNT --rpc-url $SETTLEMENT_RPC_URL --private-key $PRIVATE_KEY
Bridge
Bridge USDC to your rollup:
cast send $SETTLEMENT_USDC_BRIDGE_ADDRESS "sendMessage(address,uint256,uint32)" $(cast wallet address $PRIVATE_KEY) $AMOUNT 100000 --rpc-url $SETTLEMENT_RPC_URL --private-key $PRIVATE_KEY
Withdrawing
After a few minutes, your deposit should be processed and available on your rollup. To withdraw USDC, follow these steps:
Approve
Approve the rollup bridge contract to transfer your USDC:
cast send $ROLLUP_USDC_TOKEN_ADDRESS "approve(address,uint256)" $ROLLUP_USDC_BRIDGE_ADDRESS $AMOUNT --rpc-url $ROLLUP_RPC_URL --private-key $PRIVATE_KEY
Bridge
Send USDC from your rollup back to the Settlement Layer:
cast send $ROLLUP_USDC_BRIDGE_ADDRESS "sendMessage(address,uint256,uint32)" $(cast wallet address $PRIVATE_KEY) $AMOUNT 100000 --rpc-url $ROLLUP_RPC_URL --private-key $PRIVATE_KEY
Learn More
For a detailed overview of how the USDC bridge functions on Optimism, you can find the official documentation and the repository here: