Skip to content

Commit

Permalink
chore: chain policies for all chains (#10829)
Browse files Browse the repository at this point in the history
refs: #10714

## Description
- Adds ChainPolicies for all 5 FUSDC chains
- Adds MN values for `attenuatedCttpBridgeAddress` and `cctpTokenMessengerAddress`.
- Adds Testnet values for `cctpTokenMessengerAddress` and `chainId` (* Sepolia network for most, as that's where Circle deploys)

### Security Considerations
None really, but it's important these are the correct values.

### Scaling Considerations
None

### Documentation Considerations
None

### Testing Considerations
None

### Upgrade Considerations
None, part of initial release.
  • Loading branch information
mergify[bot] authored Jan 9, 2025
2 parents 78063fc + 34228ac commit 537ffd0
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 36 deletions.
25 changes: 25 additions & 0 deletions packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,32 @@ Generated by [AVA](https://avajs.dev).
chainId: 42161,
confirmations: 2,
},
Base: {
attenuatedCttpBridgeAddress: '0xB6615B2662b35fc3533F8479002e62D0523341De',
cctpTokenMessengerAddress: '0x1682Ae6375C4E4A97e4B583BC394c861A46D8962',
chainId: 8453,
confirmations: 2,
},
Ethereum: {
attenuatedCttpBridgeAddress: '0xBC8552339dA68EB65C8b88B414B5854E0E366cFc',
cctpTokenMessengerAddress: '0xBd3fa81B58Ba92a82136038B25aDec7066af3155',
chainId: 1,
confirmations: 2,
},
Optimism: {
attenuatedCttpBridgeAddress: '0x48C5417ED570928eC85D5e3AD4e7E0EeD7dB1E2A',
cctpTokenMessengerAddress: '0x2B4069517957735bE00ceE0fadAE88a26365528f',
chainId: 10,
confirmations: 2,
},
Polygon: {
attenuatedCttpBridgeAddress: '0x32cb9574650AFF312c80edc4B4343Ff5500767cA',
cctpTokenMessengerAddress: '0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE',
chainId: 137,
confirmations: 2,
},
},
eventFilter: 'DepositForBurn(uint64,address,uint256,address,bytes32,uint32,bytes32,bytes32)',
nobleAgoricChannelId: 'channel-21',
nobleDomainId: 4,
},
Expand Down
Binary file modified packages/boot/test/fast-usdc/snapshots/fast-usdc.test.ts.snap
Binary file not shown.
75 changes: 75 additions & 0 deletions packages/fast-usdc/src/utils/chain-policies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/** @import {ChainPolicy} from '../types.js'; */

/** @satisfies {Record<'MAINNET'| 'TESTNET', Record<string, ChainPolicy>>} */
export const ChainPolicies = /** @type {const} */ ({
MAINNET: {
Arbitrum: {
attenuatedCttpBridgeAddress: '0xe298b93ffB5eA1FB628e0C0D55A43aeaC268e347',
cctpTokenMessengerAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
chainId: 42161,
confirmations: 2, // TODO placeholder
},
Base: {
attenuatedCttpBridgeAddress: '0xB6615B2662b35fc3533F8479002e62D0523341De',
cctpTokenMessengerAddress: '0x1682Ae6375C4E4A97e4B583BC394c861A46D8962',
chainId: 8453,
confirmations: 2, // TODO placeholder
},
Ethereum: {
attenuatedCttpBridgeAddress: '0xBC8552339dA68EB65C8b88B414B5854E0E366cFc',
cctpTokenMessengerAddress: '0xBd3fa81B58Ba92a82136038B25aDec7066af3155',
chainId: 1,
confirmations: 2, // TODO placeholder
},
Optimism: {
attenuatedCttpBridgeAddress: '0x48C5417ED570928eC85D5e3AD4e7E0EeD7dB1E2A',
cctpTokenMessengerAddress: '0x2B4069517957735bE00ceE0fadAE88a26365528f',
chainId: 10,
confirmations: 2, // TODO placeholder
},
Polygon: {
attenuatedCttpBridgeAddress: '0x32cb9574650AFF312c80edc4B4343Ff5500767cA',
cctpTokenMessengerAddress: '0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE',
chainId: 137,
confirmations: 2, // TODO placeholder
},
},
TESTNET: {
// Arbitrum Sepolia
Arbitrum: {
attenuatedCttpBridgeAddress: '0xTODO',
cctpTokenMessengerAddress: '0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5',
chainId: 421614,
confirmations: 2, // TODO placeholder
},
// Base Sepolia
Base: {
attenuatedCttpBridgeAddress: '0xTODO',
cctpTokenMessengerAddress: '0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5',
chainId: 84532,
confirmations: 2, // TODO placeholder
},
// Ethereum Sepolia
Ethereum: {
attenuatedCttpBridgeAddress: '0xTODO',
cctpTokenMessengerAddress: '0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5',
chainId: 11155111,
confirmations: 2, // TODO placeholder
},
// OP Sepolia
Optimism: {
attenuatedCttpBridgeAddress: '0xTODO',
cctpTokenMessengerAddress: '0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5',
chainId: 11155420,
confirmations: 2, // TODO placeholder
},
// Polygon PoS Amoy
Polygon: {
attenuatedCttpBridgeAddress: '0xTODO',
cctpTokenMessengerAddress: '0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5',
chainId: 80002,
confirmations: 2, // TODO placeholder
},
},
});
harden(ChainPolicies);
49 changes: 13 additions & 36 deletions packages/fast-usdc/src/utils/deploy-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { denomHash, withChainCapabilities } from '@agoric/orchestration';
import fetchedChainInfo from '@agoric/orchestration/src/fetched-chain-info.js';
import { ChainPolicies } from './chain-policies.js';

/**
* @import {FastUSDCConfig} from '@agoric/fast-usdc/src/types.js'
Expand Down Expand Up @@ -41,6 +42,10 @@ const agoricAssetInfo = defaultAssetInfo.filter(
([_d, i]) => i.chainName === 'agoric',
);

/** ABI for DepositForBurn event in TokenMessenger contract */
const DepositForBurnEvent =
'DepositForBurn(uint64,address,uint256,address,bytes32,uint32,bytes32,bytes32)';

/**
* @type {Record<string, Pick<FastUSDCConfig, 'oracles' | 'feedPolicy' | 'chainInfo' | 'assetInfo' >>}
*
Expand All @@ -62,16 +67,8 @@ export const configurations = {
feedPolicy: {
nobleAgoricChannelId: 'channel-does-not-exist',
nobleDomainId: 4,
chainPolicies: {
Arbitrum: {
attenuatedCttpBridgeAddress:
'0xe298b93ffB5eA1FB628e0C0D55A43aeaC268e347',
cctpTokenMessengerAddress:
'0x19330d10D9Cc8751218eaf51E8885D058642E08A',
chainId: 42161,
confirmations: 2,
},
},
chainPolicies: ChainPolicies.TESTNET,
eventFilter: DepositForBurnEvent,
},
chainInfo: /** @type {Record<string, CosmosChainInfo & Passable>} */ (
withChainCapabilities({
Expand All @@ -91,16 +88,8 @@ export const configurations = {
feedPolicy: {
nobleAgoricChannelId: 'channel-21',
nobleDomainId: 4,
chainPolicies: {
Arbitrum: {
attenuatedCttpBridgeAddress:
'0xe298b93ffB5eA1FB628e0C0D55A43aeaC268e347',
cctpTokenMessengerAddress:
'0x19330d10D9Cc8751218eaf51E8885D058642E08A',
chainId: 42161,
confirmations: 2,
},
},
chainPolicies: ChainPolicies.MAINNET,
eventFilter: DepositForBurnEvent,
},
chainInfo: /** @type {Record<string, CosmosChainInfo & Passable>} */ (
withChainCapabilities(fetchedChainInfo)
Expand All @@ -118,14 +107,8 @@ export const configurations = {
feedPolicy: {
nobleAgoricChannelId: 'TODO',
nobleDomainId: 4,
chainPolicies: {
Arbitrum: {
attenuatedCttpBridgeAddress: '0xTODO',
cctpTokenMessengerAddress: '0xTODO',
chainId: 421614,
confirmations: 2,
},
},
chainPolicies: ChainPolicies.TESTNET,
eventFilter: DepositForBurnEvent,
},
chainInfo: /** @type {Record<string, CosmosChainInfo & Passable>} */ (
withChainCapabilities(fetchedChainInfo) // TODO: use devnet values
Expand All @@ -140,14 +123,8 @@ export const configurations = {
feedPolicy: {
nobleAgoricChannelId: 'TODO',
nobleDomainId: 4,
chainPolicies: {
Arbitrum: {
attenuatedCttpBridgeAddress: '0xTODO',
cctpTokenMessengerAddress: '0xTODO',
chainId: 421614,
confirmations: 2,
},
},
chainPolicies: ChainPolicies.TESTNET,
eventFilter: DepositForBurnEvent,
},
chainInfo: /** @type {Record<string, CosmosChainInfo & Passable>} */ (
withChainCapabilities(fetchedChainInfo) // TODO: use emerynet values
Expand Down

0 comments on commit 537ffd0

Please sign in to comment.