Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Changes to allow "votable" config for votable ERC20 warp routes #59

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions config/warp_tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { WarpRouteConfig } from '../src/warp/config';
// A config for deploying Warp Routes to a set of chains
// Not required for Hyperlane core deployments
export const warpRouteConfig: WarpRouteConfig = {
// votable:true You can enable this config if you want to make your synthetic ERC20 tokens votable
Copy link
Contributor

Choose a reason for hiding this comment

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

Put these on different lines to make it obvious that votable is something that can be commented out

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, shouldn't this be on the synthetics part of the config? So move it to line 21?

Copy link
Author

Choose a reason for hiding this comment

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

I have updated it. Now you have the votable options both in the base as well as the synthetic chain. If votable is true in the base chain it will deploy the HypERC20CollateralVotable.sol and similarly, in the synthetic chain HypERC20Votable.sol

base: {
// Chain name must be in the Hyperlane SDK or in the chains.ts config
chainName: 'anvil1',
Expand Down
7 changes: 4 additions & 3 deletions src/warp/WarpRouteDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,10 @@ export class WarpRouteDeployer {

async deploy(): Promise<void> {
const { configMap, baseToken } = await this.buildHypERC20Config();

this.logger('Initiating HypERC20 deployments');
const deployer = new HypERC20Deployer(this.multiProvider);
await deployer.deploy(configMap);
this.logger('HypERC20 deployments complete');

this.writeDeploymentResult(
deployer.deployedContracts,
configMap,
Expand All @@ -81,7 +79,7 @@ export class WarpRouteDeployer {

async buildHypERC20Config() {
validateWarpTokenConfig(warpRouteConfig);
const { base, synthetics } = warpRouteConfig;
const { votable, base, synthetics } = warpRouteConfig;
const { type: baseType, chainName: baseChainName } = base;

const baseTokenAddr =
Expand Down Expand Up @@ -119,9 +117,12 @@ export class WarpRouteDeployer {
JSON.stringify(configMap[baseChainName]),
);


Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary whitespace change


for (const synthetic of synthetics) {
const sChainName = synthetic.chainName;
configMap[sChainName] = {
votable: votable,
type: TokenType.synthetic,
name: synthetic.name || baseTokenMetadata.name,
symbol: synthetic.symbol || baseTokenMetadata.symbol,
Expand Down
1 change: 1 addition & 0 deletions src/warp/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type WarpBaseTokenConfig =
| WarpCollateralTokenConfig;

export interface WarpRouteConfig {
votable?: boolean;
base: WarpBaseTokenConfig;
synthetics: WarpSyntheticTokenConfig[];
}
Expand Down