From 2c2f397192a9cb2569188785ddcdf579f6e44fe5 Mon Sep 17 00:00:00 2001 From: armanthepythonguy Date: Fri, 23 Jun 2023 19:10:07 +0530 Subject: [PATCH 1/5] added votable option --- config/warp_tokens.ts | 2 +- src/warp/WarpRouteDeployer.ts | 34 +++++++++++++++++++++++----------- src/warp/config.ts | 1 + 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/config/warp_tokens.ts b/config/warp_tokens.ts index 670e99e..e033982 100644 --- a/config/warp_tokens.ts +++ b/config/warp_tokens.ts @@ -26,4 +26,4 @@ export const warpRouteConfig: WarpRouteConfig = { // If not specified, the Permissionless Deployment artifacts or the SDK's defaults will be used }, ], -}; +}; \ No newline at end of file diff --git a/src/warp/WarpRouteDeployer.ts b/src/warp/WarpRouteDeployer.ts index f35f4a6..795876a 100644 --- a/src/warp/WarpRouteDeployer.ts +++ b/src/warp/WarpRouteDeployer.ts @@ -4,6 +4,7 @@ import yargs from 'yargs'; import { ERC20__factory, HypERC20Deployer, + HypERC20VotableDeployer, HypERC20Factories, TokenConfig, TokenType, @@ -66,17 +67,28 @@ export class WarpRouteDeployer { async deploy(): Promise { 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, - baseToken, - ); + const {votable} = warpRouteConfig; + if(votable === true){ + this.logger('Initiating HypERC20Votable deployments'); + const deployer = new HypERC20VotableDeployer(this.multiProvider); + await deployer.deploy(configMap); + this.logger('HypERC20Votable deployments complete'); + this.writeDeploymentResult( + deployer.deployedContracts, + configMap, + baseToken, + ); + }else{ + 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, + baseToken, + ); + } } async buildHypERC20Config() { diff --git a/src/warp/config.ts b/src/warp/config.ts index 972a009..5635381 100644 --- a/src/warp/config.ts +++ b/src/warp/config.ts @@ -29,6 +29,7 @@ export type WarpBaseTokenConfig = | WarpCollateralTokenConfig; export interface WarpRouteConfig { + votable?: boolean; base: WarpBaseTokenConfig; synthetics: WarpSyntheticTokenConfig[]; } From 3263602af112e5eeaa04d78019fdd1c7897bdffb Mon Sep 17 00:00:00 2001 From: armanthepythonguy Date: Fri, 23 Jun 2023 19:16:07 +0530 Subject: [PATCH 2/5] added comments on votable --- config/warp_tokens.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/config/warp_tokens.ts b/config/warp_tokens.ts index e033982..b533b36 100644 --- a/config/warp_tokens.ts +++ b/config/warp_tokens.ts @@ -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, use this option if you want to deploy an ERC20 synthetic with votable options needed for DAOs base: { // Chain name must be in the Hyperlane SDK or in the chains.ts config chainName: 'anvil1', From f2a6083fa88a9bee51f8092f1ca2fd958f44472a Mon Sep 17 00:00:00 2001 From: armanthepythonguy Date: Fri, 23 Jun 2023 22:44:26 +0530 Subject: [PATCH 3/5] added votable options --- config/warp_tokens.ts | 4 ++-- src/warp/WarpRouteDeployer.ts | 37 ++++++++++++----------------------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/config/warp_tokens.ts b/config/warp_tokens.ts index b533b36..fde265a 100644 --- a/config/warp_tokens.ts +++ b/config/warp_tokens.ts @@ -5,7 +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, use this option if you want to deploy an ERC20 synthetic with votable options needed for DAOs + // votable:true You can enable this config if you want to make your synthetic ERC20 tokens votable base: { // Chain name must be in the Hyperlane SDK or in the chains.ts config chainName: 'anvil1', @@ -27,4 +27,4 @@ export const warpRouteConfig: WarpRouteConfig = { // If not specified, the Permissionless Deployment artifacts or the SDK's defaults will be used }, ], -}; \ No newline at end of file +}; diff --git a/src/warp/WarpRouteDeployer.ts b/src/warp/WarpRouteDeployer.ts index 795876a..fa7afeb 100644 --- a/src/warp/WarpRouteDeployer.ts +++ b/src/warp/WarpRouteDeployer.ts @@ -4,7 +4,6 @@ import yargs from 'yargs'; import { ERC20__factory, HypERC20Deployer, - HypERC20VotableDeployer, HypERC20Factories, TokenConfig, TokenType, @@ -67,33 +66,20 @@ export class WarpRouteDeployer { async deploy(): Promise { const { configMap, baseToken } = await this.buildHypERC20Config(); - const {votable} = warpRouteConfig; - if(votable === true){ - this.logger('Initiating HypERC20Votable deployments'); - const deployer = new HypERC20VotableDeployer(this.multiProvider); - await deployer.deploy(configMap); - this.logger('HypERC20Votable deployments complete'); - this.writeDeploymentResult( - deployer.deployedContracts, - configMap, - baseToken, - ); - }else{ - 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, - baseToken, - ); - } + 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, + baseToken, + ); } async buildHypERC20Config() { validateWarpTokenConfig(warpRouteConfig); - const { base, synthetics } = warpRouteConfig; + const { votable, base, synthetics } = warpRouteConfig; const { type: baseType, chainName: baseChainName } = base; const baseTokenAddr = @@ -131,9 +117,12 @@ export class WarpRouteDeployer { JSON.stringify(configMap[baseChainName]), ); + + 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, From 721320d6c10d0f90433060fcc29bbfd76b608862 Mon Sep 17 00:00:00 2001 From: armanthepythonguy Date: Tue, 27 Jun 2023 16:02:11 +0530 Subject: [PATCH 4/5] votable extension --- config/warp_tokens.ts | 6 ++++-- src/warp/WarpRouteDeployer.ts | 5 +++-- src/warp/config.ts | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config/warp_tokens.ts b/config/warp_tokens.ts index fde265a..b805748 100644 --- a/config/warp_tokens.ts +++ b/config/warp_tokens.ts @@ -5,7 +5,6 @@ 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 base: { // Chain name must be in the Hyperlane SDK or in the chains.ts config chainName: 'anvil1', @@ -15,6 +14,8 @@ export const warpRouteConfig: WarpRouteConfig = { // Optionally, specify owner, mailbox, and interchainGasPaymaster addresses // If not specified, the Permissionless Deployment artifacts or the SDK's defaults will be used + //votable:true, if you enable this option you will be able to delegate the voting power of the locked tokens + }, synthetics: [ { @@ -25,6 +26,7 @@ export const warpRouteConfig: WarpRouteConfig = { // Optionally, specify owner, mailbox, and interchainGasPaymaster addresses // If not specified, the Permissionless Deployment artifacts or the SDK's defaults will be used + //votable:true, if you enable this option then ERC20 votable synthetic token will be deployed }, ], -}; +}; \ No newline at end of file diff --git a/src/warp/WarpRouteDeployer.ts b/src/warp/WarpRouteDeployer.ts index fa7afeb..5c885cd 100644 --- a/src/warp/WarpRouteDeployer.ts +++ b/src/warp/WarpRouteDeployer.ts @@ -79,7 +79,7 @@ export class WarpRouteDeployer { async buildHypERC20Config() { validateWarpTokenConfig(warpRouteConfig); - const { votable, base, synthetics } = warpRouteConfig; + const { base, synthetics } = warpRouteConfig; const { type: baseType, chainName: baseChainName } = base; const baseTokenAddr = @@ -99,6 +99,7 @@ export class WarpRouteDeployer { const configMap: ChainMap = { [baseChainName]: { + votable: base.votable, type: baseType, token: baseTokenAddr, owner, @@ -122,7 +123,7 @@ export class WarpRouteDeployer { for (const synthetic of synthetics) { const sChainName = synthetic.chainName; configMap[sChainName] = { - votable: votable, + votable: synthetic.votable, type: TokenType.synthetic, name: synthetic.name || baseTokenMetadata.name, symbol: synthetic.symbol || baseTokenMetadata.symbol, diff --git a/src/warp/config.ts b/src/warp/config.ts index 5635381..cb67fc1 100644 --- a/src/warp/config.ts +++ b/src/warp/config.ts @@ -9,15 +9,18 @@ type WarpBaseToken = { } & Partial; export interface WarpNativeTokenConfig extends WarpBaseToken { + votable?: boolean; type: TokenType.native; } export interface WarpCollateralTokenConfig extends WarpBaseToken { + votable?: boolean; type: TokenType.collateral; address: string; } export type WarpSyntheticTokenConfig = { + votable?:boolean; chainName: string; name?: string; symbol?: string; @@ -29,7 +32,6 @@ export type WarpBaseTokenConfig = | WarpCollateralTokenConfig; export interface WarpRouteConfig { - votable?: boolean; base: WarpBaseTokenConfig; synthetics: WarpSyntheticTokenConfig[]; } From c56746fcef7f697d6cb6a0bab89a2e05fe278a83 Mon Sep 17 00:00:00 2001 From: armanthepythonguy Date: Wed, 5 Jul 2023 18:31:09 +0530 Subject: [PATCH 5/5] removed whitesapces --- config/warp_tokens.ts | 3 --- src/warp/WarpRouteDeployer.ts | 2 -- 2 files changed, 5 deletions(-) diff --git a/config/warp_tokens.ts b/config/warp_tokens.ts index b805748..94864b8 100644 --- a/config/warp_tokens.ts +++ b/config/warp_tokens.ts @@ -11,7 +11,6 @@ export const warpRouteConfig: WarpRouteConfig = { type: TokenType.native, // TokenType.native or TokenType.collateral // If type is collateral, a token address is required: // address: '0x123...' - // Optionally, specify owner, mailbox, and interchainGasPaymaster addresses // If not specified, the Permissionless Deployment artifacts or the SDK's defaults will be used //votable:true, if you enable this option you will be able to delegate the voting power of the locked tokens @@ -20,10 +19,8 @@ export const warpRouteConfig: WarpRouteConfig = { synthetics: [ { chainName: 'anvil2', - // Optionally specify a name, symbol, and totalSupply // If not specified, the base token's properties will be used - // Optionally, specify owner, mailbox, and interchainGasPaymaster addresses // If not specified, the Permissionless Deployment artifacts or the SDK's defaults will be used //votable:true, if you enable this option then ERC20 votable synthetic token will be deployed diff --git a/src/warp/WarpRouteDeployer.ts b/src/warp/WarpRouteDeployer.ts index 5c885cd..5287450 100644 --- a/src/warp/WarpRouteDeployer.ts +++ b/src/warp/WarpRouteDeployer.ts @@ -118,8 +118,6 @@ export class WarpRouteDeployer { JSON.stringify(configMap[baseChainName]), ); - - for (const synthetic of synthetics) { const sChainName = synthetic.chainName; configMap[sChainName] = {