diff --git a/scripts/usdc-bridge-deployment/README.md b/scripts/usdc-bridge-deployment/README.md index bc0fc782a..39bdd23d0 100644 --- a/scripts/usdc-bridge-deployment/README.md +++ b/scripts/usdc-bridge-deployment/README.md @@ -36,7 +36,16 @@ CHILD_DEPLOYER_KEY= L1_ROUTER= L2_ROUTER= INBOX= + +## USDC (or EURC) address on the parent chain L1_USDC= + +## Naming params for the bridged token which is deployed to child chain. Values should be adjusted based on the parent chain and currency used +## Circle's naming guideline: https://brand.circle.com/d/M9z54TaEwsWL/stablecoins#/-/usdc-brand-guide/usdc-naming-guidelines +L2_TOKEN_NAME='USDC' +L2_TOKEN_SYMBOL='USDC.e' +L2_TOKEN_CURRENCY='USD' + ## OPTIONAL arg. If set, script will register the gateway, otherwise it will store TX payload in a file ROLLUP_OWNER_KEY= ``` @@ -80,3 +89,7 @@ Once transition to native USDC is agreed on, following steps are required: - Circle calls `burnLockedUSDC()` on the L1 gateway using `burner` account to burn the `burnAmount` of USDC - remaining USDC will be cleared off when remaining in-flight USDC withdrawals are executed, if any - L1 gateway owner is trusted to not frontrun this TX to modify the burning amount + +## EURC deployment + +Circle also offers EURC stablecoin. This same standard implementation is applicable for EURC. There is no need to change anything, except to adjust the .env vars to provide EURC parent chain address instead of the USDC address and adjust the token naming vars (name, symbol, currency). diff --git a/scripts/usdc-bridge-deployment/deployUsdcBridge.ts b/scripts/usdc-bridge-deployment/deployUsdcBridge.ts index 68fb06e66..9cd30f9f6 100644 --- a/scripts/usdc-bridge-deployment/deployUsdcBridge.ts +++ b/scripts/usdc-bridge-deployment/deployUsdcBridge.ts @@ -71,6 +71,9 @@ main().then(() => console.log('Done.')) * - if `ROLLUP_OWNER_KEY` is provided, register the gateway in the router through the UpgradeExecutor * - if `ROLLUP_OWNER_KEY` is not provided, prepare calldata and store it in `registerUsdcGatewayTx.json` file * - set minter role to L2 USDC gateway with max allowance + * + * Note: Same implementation is used for bridged EURC (Circle's euro stablecoin). The only difference is in the + * name/symbol/currency of the L2 token deployment. */ async function main() { console.log('Starting USDC bridge deployment') @@ -184,14 +187,18 @@ async function _deployBridgedUsdc( deployerL2Wallet ) + const tokenName = process.env['L2_TOKEN_NAME'] as string + const tokenSymbol = process.env['L2_TOKEN_SYMBOL'] as string + const tokenCurrency = process.env['L2_TOKEN_CURRENCY'] as string + const pauserL2 = deployerL2Wallet const blacklisterL2 = deployerL2Wallet const lostAndFound = deployerL2Wallet await ( await l2UsdcFiatToken.initialize( - 'USDC', - 'USDC.e', - 'USD', + tokenName, + tokenSymbol, + tokenCurrency, 6, masterMinter.address, pauserL2.address, @@ -199,15 +206,16 @@ async function _deployBridgedUsdc( deployerL2Wallet.address ) ).wait() - await (await l2UsdcFiatToken.initializeV2('USDC')).wait() + + await (await l2UsdcFiatToken.initializeV2(tokenName)).wait() await (await l2UsdcFiatToken.initializeV2_1(lostAndFound.address)).wait() - await (await l2UsdcFiatToken.initializeV2_2([], 'USDC.e')).wait() + await (await l2UsdcFiatToken.initializeV2_2([], tokenSymbol)).wait() /// verify initialization if ( - (await l2UsdcFiatToken.name()) != 'USDC' || - (await l2UsdcFiatToken.symbol()) != 'USDC.e' || - (await l2UsdcFiatToken.currency()) != 'USD' || + (await l2UsdcFiatToken.name()) != tokenName || + (await l2UsdcFiatToken.symbol()) != tokenSymbol || + (await l2UsdcFiatToken.currency()) != tokenCurrency || (await l2UsdcFiatToken.decimals()) != 6 || (await l2UsdcFiatToken.masterMinter()) != masterMinter.address || (await l2UsdcFiatToken.pauser()) != pauserL2.address || @@ -755,6 +763,9 @@ function _checkEnvVars() { 'L2_ROUTER', 'INBOX', 'L1_USDC', + 'L2_TOKEN_NAME', + 'L2_TOKEN_SYMBOL', + 'L2_TOKEN_CURRENCY', ] for (const envVar of requiredEnvVars) { diff --git a/scripts/usdc-bridge-deployment/env.example b/scripts/usdc-bridge-deployment/env.example index c6eefe980..3468c3835 100644 --- a/scripts/usdc-bridge-deployment/env.example +++ b/scripts/usdc-bridge-deployment/env.example @@ -5,6 +5,15 @@ CHILD_DEPLOYER_KEY= L1_ROUTER= L2_ROUTER= INBOX= + +## USDC (or EURC) address on the parent chain L1_USDC= + +## Naming params for the bridged token which is deployed to child chain. Values should be adjusted based on the parent chain and currency used +## Circle's naming guideline: https://brand.circle.com/d/M9z54TaEwsWL/stablecoins#/-/usdc-brand-guide/usdc-naming-guidelines +L2_TOKEN_NAME='USDC' +L2_TOKEN_SYMBOL='USDC.e' +L2_TOKEN_CURRENCY='USD' + ## OPTIONAL arg. If set, script will register the gateway, otherwise it will store TX payload in a file ROLLUP_OWNER_KEY= \ No newline at end of file