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 4 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
5 changes: 4 additions & 1 deletion config/warp_tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,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: [
{
Expand All @@ -24,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
},
],
};
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this whitespace change

6 changes: 4 additions & 2 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 Down Expand Up @@ -101,6 +99,7 @@ export class WarpRouteDeployer {

const configMap: ChainMap<TokenConfig & RouterConfig> = {
[baseChainName]: {
votable: base.votable,
type: baseType,
token: baseTokenAddr,
owner,
Expand All @@ -119,9 +118,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: synthetic.votable,
type: TokenType.synthetic,
name: synthetic.name || baseTokenMetadata.name,
symbol: synthetic.symbol || baseTokenMetadata.symbol,
Expand Down
3 changes: 3 additions & 0 deletions src/warp/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ type WarpBaseToken = {
} & Partial<ConnectionClientConfig>;

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;
Expand Down