Skip to content

Commit

Permalink
chore: transfer ownership for cbBTC warp deploy on Flow <> Ethereum (#…
Browse files Browse the repository at this point in the history
…4893)

### Description

- Transfers ownership of the cbBTC warp route between flow and ethereum
- A fix to ensure that proxy admin ownership is set

### Drive-by changes

- a driveby to prevent rebuilding the multiprovider tons of times in the
check warp deploy script

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
  • Loading branch information
tkporter authored Nov 25, 2024
1 parent 81ab433 commit 3f013d1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,30 @@ import {
RouterConfigWithoutOwner,
tokens,
} from '../../../../../src/config/warp.js';
import { DEPLOYER } from '../../owners.js';

// Keep on our deployer for now until we get an address from Flow
const owner = DEPLOYER;
const ownerConfig = getOwnerConfigForAddress(owner);
// Flow team Safe
const ethereumOwner = '0x58C3FB862a4F5f038C24F8506BE378e9415c5B6C';
const ethereumOwnerConfig = getOwnerConfigForAddress(ethereumOwner);

// Flow team Safe
const flowOwner = '0xa507DFccA02727B46cBdC600C57E89b2b55E5330';
const flowOwnerConfig = getOwnerConfigForAddress(flowOwner);

export const getEthereumFlowCbBTCWarpConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
_abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<TokenRouterConfig>> => {
const ethereum: TokenRouterConfig = {
...routerConfig.ethereum,
...ownerConfig,
...ethereumOwnerConfig,
type: TokenType.collateral,
token: tokens.ethereum.cbBTC,
interchainSecurityModule: ethers.constants.AddressZero,
};

const flowmainnet: TokenRouterConfig = {
...routerConfig.flowmainnet,
...ownerConfig,
...flowOwnerConfig,
type: TokenType.synthetic,
interchainSecurityModule: ethers.constants.AddressZero,
};
Expand Down
7 changes: 6 additions & 1 deletion typescript/infra/scripts/check/check-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
InterchainAccountConfig,
InterchainQuery,
InterchainQueryChecker,
MultiProvider,
attachContractsMapAndGetForeignDeployments,
hypERC20factories,
proxiedFactories,
Expand Down Expand Up @@ -72,9 +73,13 @@ export async function getGovernor(
chains?: string[],
fork?: string,
govern?: boolean,
multiProvider: MultiProvider | undefined = undefined,
) {
const envConfig = getEnvironmentConfig(environment);
let multiProvider = await envConfig.getMultiProvider();
// If the multiProvider is not passed in, get it from the environment
if (!multiProvider) {
multiProvider = await envConfig.getMultiProvider();
}

// must rotate to forked provider before building core contracts
if (fork) {
Expand Down
7 changes: 7 additions & 0 deletions typescript/infra/scripts/check/check-warp-deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Gauge, Registry } from 'prom-client';
import { warpConfigGetterMap } from '../../config/warp.js';
import { submitMetrics } from '../../src/utils/metrics.js';
import { Modules } from '../agent-utils.js';
import { getEnvironmentConfig } from '../core-utils.js';

import {
getCheckWarpDeployArgs,
Expand All @@ -16,6 +17,10 @@ async function main() {
const { environment, asDeployer, chains, fork, context, pushMetrics } =
await getCheckWarpDeployArgs().argv;

const envConfig = getEnvironmentConfig(environment);
// Get the multiprovider once to avoid recreating it for each warp route
const multiProvider = await envConfig.getMultiProvider();

const metricsRegister = new Registry();
const checkerViolationsGauge = new Gauge(
getCheckerViolationsGaugeObj(metricsRegister),
Expand All @@ -38,6 +43,8 @@ async function main() {
warpRouteId,
chains,
fork,
false,
multiProvider,
);

await governor.check();
Expand Down
4 changes: 3 additions & 1 deletion typescript/infra/src/config/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export function getOwnerConfigForAddress(owner: string): OwnableConfig {
return {
owner,
// To ensure that any other overrides aren't applied
ownerOverrides: {},
ownerOverrides: {
proxyAdmin: owner,
},
};
}

0 comments on commit 3f013d1

Please sign in to comment.