Skip to content

Commit

Permalink
Restore utils
Browse files Browse the repository at this point in the history
  • Loading branch information
yorhodes committed May 12, 2024
1 parent bb0e68f commit d37436f
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 8 deletions.
31 changes: 31 additions & 0 deletions typescript/cli/coredefault
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { CoreConfig, HookType, IsmType } from "@hyperlane-xyz/sdk";
import { detectAndConfirmOrPrompt } from "../utils/chains.js";

const deployer = await detectAndConfirmOrPrompt(
async () => {
const accounts = await provider.listAccounts();
return accounts[0];
},
'address',
'Enter a deployer',
);

const coreConfig: CoreConfig = {
owner: deployer,
defaultHook: {
type: HookType.MERKLE_TREE,
},
requiredHook: {
type: HookType.PROTOCOL_FEE,
owner: deployer,
beneficiary: deployer,
protocolFee: '0',
maxProtocolFee: '10000000000000',
},
defaultIsm: {
type: IsmType.TRUSTED_RELAYER,
relayer: deployer,
},
};

export default coreConfig;
34 changes: 34 additions & 0 deletions typescript/cli/testnet-xerc20.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# A config for a Warp Route deployment
# Typically used with the 'hyperlane deploy warp' command
#
# Token Types:
# native
# collateral
# synthetic
#
# see comprehensive [list](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/token/config.ts#L8)
---
sepolia:
type: collateralXERC20
token: "0x6f8B045D2645872bC2214BBbbC4Ee2EaeA477857"
# mailbox: "0x123" # mailbox address route
# token: "0x123" # Collateral/vault address. Required for collateral types
# owner: "0x123" # Optional owner address for synthetic token
# interchainGasPaymaster: "0x123" # Optional interchainGasPaymaster address
# isNft: true # If the token is an NFT (ERC721), set to true
# You can optionally set the token metadata
# name: "MyCollateralToken"
# symbol: "MCT"
# totalSupply: 10000000

arbitrumsepolia:
type: collateralXERC20
token: "0x6e64Eb73b9666A10d83f9Bd10BE41efd640553e6"
# token: "0x123" # Collateral/vault address. Required for collateral types
# owner: "0x123" # Optional owner address for synthetic token
# mailbox: "0x123" # mailbox address route
# interchainGasPaymaster: "0x123" # Optional interchainGasPaymaster address
# You can optionally set the token metadata
# name: "MySyntheticToken"
# symbol: "MST"
# totalSupply: 10000000
5 changes: 0 additions & 5 deletions typescript/utils/src/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,3 @@ export function ensure0x(hexstr: string) {
export function strip0x(hexstr: string) {
return hexstr.startsWith('0x') ? hexstr.slice(2) : hexstr;
}

export const fromHexString = (hexstr: string) =>
Buffer.from(strip0x(hexstr), 'hex');

export const toHexString = (buf: Buffer) => ensure0x(buf.toString('hex'));
3 changes: 0 additions & 3 deletions typescript/utils/src/async.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { rootLogger } from './logging.js';

/**
* Return a promise that resolves in ms milliseconds.
* @param ms Time to wait
Expand Down Expand Up @@ -97,7 +95,6 @@ export async function pollAsync<T>(
const ret = await runner();
return ret;
} catch (error) {
rootLogger.debug(`Error in pollAsync`, { error });
saveError = error;
attempts += 1;
await sleep(delayMs);
Expand Down

0 comments on commit d37436f

Please sign in to comment.