Skip to content

chore: remove mailbox from deploy config and bump packages #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@headlessui/react": "^2.2.0",
"@hyperlane-xyz/registry": "11.2.0",
"@hyperlane-xyz/sdk": "9.2.0",
"@hyperlane-xyz/utils": "9.2.0",
"@hyperlane-xyz/widgets": "9.2.0",
"@hyperlane-xyz/registry": "13.9.0",
"@hyperlane-xyz/sdk": "12.1.0",
"@hyperlane-xyz/utils": "12.1.0",
"@hyperlane-xyz/widgets": "12.1.0",
Comment on lines +21 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest v is 12.3

"@interchain-ui/react": "^1.23.28",
"@metamask/post-message-stream": "6.1.2",
"@metamask/providers": "10.2.1",
Expand Down
8 changes: 2 additions & 6 deletions src/features/deployment/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
ChainName,
WarpCoreConfig,
WarpRouteDeployConfigMailboxRequired,
} from '@hyperlane-xyz/sdk';
import { ChainName, WarpCoreConfig, WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';

export enum DeploymentStatus {
Configured = 'configured',
Expand Down Expand Up @@ -42,7 +38,7 @@ interface ConfigBase {

export interface WarpDeploymentConfig extends ConfigBase {
type: DeploymentType.Warp;
config: WarpRouteDeployConfigMailboxRequired;
config: WarpRouteDeployConfig;
}

export interface CoreDeploymentConfig extends ConfigBase {
Expand Down
5 changes: 1 addition & 4 deletions src/features/deployment/warp/TokenTypeSelectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { TokenType } from '@hyperlane-xyz/sdk';
import { Button, ChevronIcon, Modal, useModal } from '@hyperlane-xyz/widgets';
import { FormButton } from '../../../components/buttons/FormButton';

const HiddenTokenTypes = new Set([TokenType.fastCollateral, TokenType.fastSynthetic]);
const TokenTypes = Object.values(TokenType)
.filter((token) => !HiddenTokenTypes.has(token))
Comment on lines -5 to -7
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed because sdk does not include these types anymore

.sort();
const TokenTypes = Object.values(TokenType).sort();
const PopularTokenTypes = [TokenType.collateral, TokenType.native, TokenType.synthetic];
export const TokenTypeDescriptions = {
[TokenType.collateral]: {
Expand Down
8 changes: 7 additions & 1 deletion src/features/deployment/warp/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ export async function executeDeploy(
assert(typedConfig, 'Warp deployment config is required');
logger.info('Executing warp route deployment');

const deploymentConfig = typedConfig.config;
const deploymentConfig: WarpRouteDeployConfigMailboxRequired = objMap(
typedConfig.config,
(chainName, deployConfig) => ({
...deployConfig,
mailbox: registryChainAddresses[chainName].mailbox,
}),
);
const evmWallet = wallets[ProtocolType.Ethereum];
assert(evmWallet?.type === ProviderType.EthersV5, 'EVM wallet is required for deployment');
multiProvider.setSharedSigner(evmWallet.wallet);
Expand Down
11 changes: 5 additions & 6 deletions src/features/deployment/warp/validation.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { chainAddresses } from '@hyperlane-xyz/registry';
import {
ChainMap,
HypTokenRouterConfig,
MultiProtocolProvider,
Token,
TokenMetadata,
WarpRouteDeployConfigMailboxRequired,
WarpRouteDeployConfigMailboxRequiredSchema,
WarpRouteDeployConfig,
WarpRouteDeployConfigSchema,
} from '@hyperlane-xyz/sdk';
import {
errorToString,
Expand Down Expand Up @@ -54,6 +53,7 @@ export async function validateWarpDeploymentForm(
const configItemsResults = await Promise.all(
formConfigs.map((c) => validateChainTokenConfig(c, multiProvider)),
);

const errors = configItemsResults.reduce<Record<number, string>>((acc, r, i) => {
if (!r.success) return { ...acc, [i]: r.error };
return acc;
Expand Down Expand Up @@ -124,13 +124,12 @@ function assembleWarpConfig(
routerConfigs: HypTokenRouterConfig[],
accounts: Record<ProtocolType, AccountInfo>,
multiProvider: MultiProtocolProvider,
): Result<WarpRouteDeployConfigMailboxRequired> {
): Result<WarpRouteDeployConfig> {
let warpRouteDeployConfig: ChainMap<HypTokenRouterConfig> = chainNames.reduce(
(acc, chainName, index) => {
const owner = getAccountAddressForChain(multiProvider, chainName, accounts);
acc[chainName] = {
...routerConfigs[index],
mailbox: chainAddresses[chainName].mailbox,
owner,
};
return acc;
Expand All @@ -153,7 +152,7 @@ function assembleWarpConfig(
});

const warpRouteConfigValidationResult =
WarpRouteDeployConfigMailboxRequiredSchema.safeParse(warpRouteDeployConfig);
WarpRouteDeployConfigSchema.safeParse(warpRouteDeployConfig);

if (!warpRouteConfigValidationResult.success) {
return failure(zodErrorToString(warpRouteConfigValidationResult.error));
Expand Down
4 changes: 2 additions & 2 deletions src/features/wallet/context/EvmWalletContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
walletConnectWallet,
} from '@rainbow-me/rainbowkit/wallets';
import { PropsWithChildren, useMemo } from 'react';
import { createClient, http } from 'viem';
import { createClient, fallback, http } from 'viem';
import { WagmiProvider, createConfig } from 'wagmi';
import { APP_NAME } from '../../../consts/app';
import { config } from '../../../consts/config';
Expand Down Expand Up @@ -42,7 +42,7 @@ function initWagmi(multiProvider: MultiProtocolProvider) {
chains: [chains[0], ...chains.splice(1)],
connectors,
client({ chain }) {
const transport = http(chain.rpcUrls.default.http[0]);
const transport = fallback(chain.rpcUrls.default.http.map((chainHttp) => http(chainHttp)));
return createClient({ chain, transport });
},
});
Expand Down
95 changes: 65 additions & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4413,23 +4413,25 @@ __metadata:
languageName: node
linkType: hard

"@hyperlane-xyz/core@npm:6.0.2":
version: 6.0.2
resolution: "@hyperlane-xyz/core@npm:6.0.2"
"@hyperlane-xyz/core@npm:7.1.0":
version: 7.1.0
resolution: "@hyperlane-xyz/core@npm:7.1.0"
dependencies:
"@arbitrum/nitro-contracts": "npm:^1.2.1"
"@chainlink/contracts-ccip": "npm:^1.5.0"
"@eth-optimism/contracts": "npm:^0.6.0"
"@hyperlane-xyz/utils": "npm:9.2.0"
"@hyperlane-xyz/utils": "npm:12.1.0"
"@layerzerolabs/lz-evm-oapp-v2": "npm:2.0.2"
"@matterlabs/hardhat-zksync-solc": "npm:1.2.5"
"@matterlabs/hardhat-zksync-verify": "npm:1.7.1"
"@openzeppelin/contracts": "npm:^4.9.3"
"@openzeppelin/contracts-upgradeable": "npm:^4.9.3"
fx-portal: "npm:^1.0.3"
peerDependencies:
"@ethersproject/abi": "*"
"@ethersproject/providers": "*"
"@types/sinon-chai": "*"
checksum: 10/4c2cdffead7b2c9f03b7a272940cdfa2cabb2a16d276925d4aa2f33d181949dce83cd3d3ee19054dfb1ae584dd72036f227f34ce96f6f2704f718e5499702ff0
checksum: 10/fe76fa68ccecdb1832b58e8d91fd89c3f66ff7f99b37302a5a57e5efd1d160e73fb2a34f2b36050cc40384cedfb933ffa94c8c4a0698ee8bdf0d2b79ea849980
languageName: node
linkType: hard

Expand All @@ -4450,10 +4452,10 @@ __metadata:
"@emotion/react": "npm:^11.13.3"
"@emotion/styled": "npm:^11.13.0"
"@headlessui/react": "npm:^2.2.0"
"@hyperlane-xyz/registry": "npm:11.2.0"
"@hyperlane-xyz/sdk": "npm:9.2.0"
"@hyperlane-xyz/utils": "npm:9.2.0"
"@hyperlane-xyz/widgets": "npm:9.2.0"
"@hyperlane-xyz/registry": "npm:13.9.0"
"@hyperlane-xyz/sdk": "npm:12.1.0"
"@hyperlane-xyz/utils": "npm:12.1.0"
"@hyperlane-xyz/widgets": "npm:12.1.0"
"@interchain-ui/react": "npm:^1.23.28"
"@metamask/post-message-stream": "npm:6.1.2"
"@metamask/providers": "npm:10.2.1"
Expand Down Expand Up @@ -4510,27 +4512,27 @@ __metadata:
languageName: unknown
linkType: soft

"@hyperlane-xyz/registry@npm:11.2.0":
version: 11.2.0
resolution: "@hyperlane-xyz/registry@npm:11.2.0"
"@hyperlane-xyz/registry@npm:13.9.0":
version: 13.9.0
resolution: "@hyperlane-xyz/registry@npm:13.9.0"
dependencies:
yaml: "npm:2.4.5"
zod: "npm:^3.21.2"
checksum: 10/b9765d16b82c6c53fed937f10a8aa9ff6135074d8e90ed65272450c49fa9068e037b3997e1a02a4bf1510148087cf26e4bb2829541fd679df0e424ef7c44a405
checksum: 10/df503ed73525a489488f112802f969db1ef9d32662558a539de3b66141374e1bc2df077dcba639bac55881b8a7c609f22eb4693676d3ec1b3e6dac2905afe73d
languageName: node
linkType: hard

"@hyperlane-xyz/sdk@npm:9.2.0":
version: 9.2.0
resolution: "@hyperlane-xyz/sdk@npm:9.2.0"
"@hyperlane-xyz/sdk@npm:12.1.0":
version: 12.1.0
resolution: "@hyperlane-xyz/sdk@npm:12.1.0"
dependencies:
"@arbitrum/sdk": "npm:^4.0.0"
"@aws-sdk/client-s3": "npm:^3.577.0"
"@chain-registry/types": "npm:^0.50.14"
"@cosmjs/cosmwasm-stargate": "npm:^0.32.4"
"@cosmjs/stargate": "npm:^0.32.4"
"@hyperlane-xyz/core": "npm:6.0.2"
"@hyperlane-xyz/utils": "npm:9.2.0"
"@hyperlane-xyz/core": "npm:7.1.0"
"@hyperlane-xyz/utils": "npm:12.1.0"
"@safe-global/api-kit": "npm:1.3.0"
"@safe-global/protocol-kit": "npm:1.3.0"
"@safe-global/safe-deployments": "npm:1.37.23"
Expand All @@ -4543,17 +4545,18 @@ __metadata:
pino: "npm:^8.19.0"
starknet: "npm:^6.23.1"
viem: "npm:^2.21.45"
zksync-ethers: "npm:^5.10.0"
zod: "npm:^3.21.2"
peerDependencies:
"@ethersproject/abi": "*"
"@ethersproject/providers": "*"
checksum: 10/bd17f322d721403f253f7d1658509102546e92e5e2cad6b0a78ddd1e9800d3123f35ccefa898ab36e1d58de0da553f3c03463b887e99fd4304b3652b757234eb
checksum: 10/9416031867a5b4eb2bced1903c0b6c3e6c6d79e7c16bfd6e719505970b0a3f42d45dd3cf273f0f99fc40fc5da87220f77ae1dac9c7aab3d46f70a46c21337872
languageName: node
linkType: hard

"@hyperlane-xyz/utils@npm:9.2.0":
version: 9.2.0
resolution: "@hyperlane-xyz/utils@npm:9.2.0"
"@hyperlane-xyz/utils@npm:12.1.0":
version: 12.1.0
resolution: "@hyperlane-xyz/utils@npm:12.1.0"
dependencies:
"@cosmjs/encoding": "npm:^0.32.4"
"@solana/web3.js": "npm:^1.95.4"
Expand All @@ -4562,18 +4565,18 @@ __metadata:
lodash-es: "npm:^4.17.21"
pino: "npm:^8.19.0"
yaml: "npm:2.4.5"
checksum: 10/caff35e2b66f068d3f6308af958ef697ea271bb637a8cb7ed83af9068c86ad2741ef3db9f50447d727d86a2a66751f63e7c4d87acebdbac8cc91b035aa0835fb
checksum: 10/628225400fad5fe43db506939f8ecfc0dabfffc0c29f64a7ed2a47c45898abce7134e2d8787a971939c0416b660f06b9d2fbf30454dc32dce315a8dcb83174ed
languageName: node
linkType: hard

"@hyperlane-xyz/widgets@npm:9.2.0":
version: 9.2.0
resolution: "@hyperlane-xyz/widgets@npm:9.2.0"
"@hyperlane-xyz/widgets@npm:12.1.0":
version: 12.1.0
resolution: "@hyperlane-xyz/widgets@npm:12.1.0"
dependencies:
"@cosmos-kit/react": "npm:^2.18.0"
"@headlessui/react": "npm:^2.1.8"
"@hyperlane-xyz/sdk": "npm:9.2.0"
"@hyperlane-xyz/utils": "npm:9.2.0"
"@hyperlane-xyz/sdk": "npm:12.1.0"
"@hyperlane-xyz/utils": "npm:12.1.0"
"@interchain-ui/react": "npm:^1.23.28"
"@rainbow-me/rainbowkit": "npm:^2.2.0"
"@solana/wallet-adapter-react": "npm:^0.15.32"
Expand All @@ -4588,7 +4591,7 @@ __metadata:
peerDependencies:
react: ^18
react-dom: ^18
checksum: 10/d998431efeb293990142577b1169143a8c45dde6e88bfa4f81139599e883aa9bfc3693e17c53e49b537a9cf595716251c58f47dde21dbc296fef2ade657b18c0
checksum: 10/3d970537177d29bd77a4fbd0c75d247c115134795f4d9038dfcb602bad81c667646d4b70d0e8f68b7f6714042da4f1e5340371bb333670b86e3278e3960610b0
languageName: node
linkType: hard

Expand Down Expand Up @@ -5374,6 +5377,27 @@ __metadata:
languageName: node
linkType: hard

"@matterlabs/hardhat-zksync-solc@npm:1.2.5":
version: 1.2.5
resolution: "@matterlabs/hardhat-zksync-solc@npm:1.2.5"
dependencies:
"@nomiclabs/hardhat-docker": "npm:^2.0.2"
chai: "npm:^4.3.4"
chalk: "npm:^4.1.2"
debug: "npm:^4.3.5"
dockerode: "npm:^4.0.2"
fs-extra: "npm:^11.2.0"
proper-lockfile: "npm:^4.1.2"
semver: "npm:^7.6.2"
sinon: "npm:^18.0.0"
sinon-chai: "npm:^3.7.0"
undici: "npm:^6.18.2"
peerDependencies:
hardhat: ^2.22.5
checksum: 10/0452ad5504258fad2f2d10be40cc79bb0e65d3470af75f70f60e4a94bb92f238031a13587cda51a0dfd77ef1cb028145088e2628a02db6d7a5ac721bf2816bf0
languageName: node
linkType: hard

"@matterlabs/hardhat-zksync-solc@npm:^1.2.5":
version: 1.3.0
resolution: "@matterlabs/hardhat-zksync-solc@npm:1.3.0"
Expand Down Expand Up @@ -5407,7 +5431,7 @@ __metadata:
languageName: node
linkType: hard

"@matterlabs/hardhat-zksync-verify@npm:^1.6.0":
"@matterlabs/hardhat-zksync-verify@npm:1.7.1, @matterlabs/hardhat-zksync-verify@npm:^1.6.0":
version: 1.7.1
resolution: "@matterlabs/hardhat-zksync-verify@npm:1.7.1"
dependencies:
Expand Down Expand Up @@ -26213,6 +26237,17 @@ __metadata:
languageName: node
linkType: hard

"zksync-ethers@npm:^5.10.0":
version: 5.10.0
resolution: "zksync-ethers@npm:5.10.0"
dependencies:
ethers: "npm:~5.7.0"
peerDependencies:
ethers: ~5.7.0
checksum: 10/826719e2e40731e1104cf8a0c16c758526de6ca9e907d0483eb5bd80b635f02e3cce012115b75d68976a8dd746d63d4f83d576cc3bddc18a02a49d2bc023347f
languageName: node
linkType: hard

"zksync-web3@npm:^0.14.3":
version: 0.14.4
resolution: "zksync-web3@npm:0.14.4"
Expand Down