|
| 1 | +import { ChainMap, HypTokenRouterConfig } from '@hyperlane-xyz/sdk'; |
| 2 | +import { Address } from '@hyperlane-xyz/utils'; |
| 3 | + |
| 4 | +import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js'; |
| 5 | + |
| 6 | +import { |
| 7 | + getRebalancingUSDCConfigForChain, |
| 8 | + getSyntheticTokenConfigForChain, |
| 9 | + getUSDCRebalancingBridgesConfigFor, |
| 10 | +} from './utils.js'; |
| 11 | + |
| 12 | +type DeploymentChains<T> = { |
| 13 | + arbitrum: T; |
| 14 | + base: T; |
| 15 | + ethereum: T; |
| 16 | + incentiv: T; |
| 17 | + optimism: T; |
| 18 | + polygon: T; |
| 19 | +}; |
| 20 | + |
| 21 | +const SAFE_OWNER_ADDRESS = '0x64F6C20eAeaF8418F73E1D399d8b86B9eA26e6F2'; |
| 22 | +const INCENTIV_OWNER_ADDRESS = '0x4c1B3430ec07F2D58b07a18c53B6f92603C2eF3F'; |
| 23 | + |
| 24 | +// SAFE wallets from the team |
| 25 | +const ownersByChain: DeploymentChains<Address> = { |
| 26 | + arbitrum: SAFE_OWNER_ADDRESS, |
| 27 | + base: SAFE_OWNER_ADDRESS, |
| 28 | + ethereum: SAFE_OWNER_ADDRESS, |
| 29 | + incentiv: INCENTIV_OWNER_ADDRESS, |
| 30 | + optimism: SAFE_OWNER_ADDRESS, |
| 31 | + polygon: SAFE_OWNER_ADDRESS, |
| 32 | +}; |
| 33 | + |
| 34 | +const rebalancingConfigByChain = getUSDCRebalancingBridgesConfigFor( |
| 35 | + Object.keys(ownersByChain), |
| 36 | +); |
| 37 | + |
| 38 | +export const getIncentivUSDCWarpConfig = async ( |
| 39 | + routerConfig: ChainMap<RouterConfigWithoutOwner>, |
| 40 | +): Promise<ChainMap<HypTokenRouterConfig>> => { |
| 41 | + const deployConfig: DeploymentChains<HypTokenRouterConfig> = { |
| 42 | + arbitrum: getRebalancingUSDCConfigForChain( |
| 43 | + 'arbitrum', |
| 44 | + routerConfig, |
| 45 | + ownersByChain, |
| 46 | + rebalancingConfigByChain, |
| 47 | + ), |
| 48 | + base: getRebalancingUSDCConfigForChain( |
| 49 | + 'base', |
| 50 | + routerConfig, |
| 51 | + ownersByChain, |
| 52 | + rebalancingConfigByChain, |
| 53 | + ), |
| 54 | + ethereum: getRebalancingUSDCConfigForChain( |
| 55 | + 'ethereum', |
| 56 | + routerConfig, |
| 57 | + ownersByChain, |
| 58 | + rebalancingConfigByChain, |
| 59 | + ), |
| 60 | + incentiv: getSyntheticTokenConfigForChain( |
| 61 | + 'incentiv', |
| 62 | + routerConfig, |
| 63 | + ownersByChain, |
| 64 | + ), |
| 65 | + optimism: getRebalancingUSDCConfigForChain( |
| 66 | + 'optimism', |
| 67 | + routerConfig, |
| 68 | + ownersByChain, |
| 69 | + rebalancingConfigByChain, |
| 70 | + ), |
| 71 | + polygon: getRebalancingUSDCConfigForChain( |
| 72 | + 'polygon', |
| 73 | + routerConfig, |
| 74 | + ownersByChain, |
| 75 | + rebalancingConfigByChain, |
| 76 | + ), |
| 77 | + }; |
| 78 | + |
| 79 | + return deployConfig; |
| 80 | +}; |
0 commit comments