Skip to content

Commit

Permalink
rm totalSupply
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk committed Oct 25, 2024
1 parent 1307cd6 commit c6134d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ describe('ERC20WarpRouterReader', async () => {
name: TOKEN_NAME,
symbol: TOKEN_NAME,
decimals: TOKEN_DECIMALS,
totalSupply: TOKEN_SUPPLY,
...baseConfig,
},
};
Expand Down
4 changes: 3 additions & 1 deletion typescript/sdk/src/token/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ abstract class TokenDeployer<
];
if (isCollateralConfig(config) || isNativeConfig(config)) {
return defaultArgs;
} else if (isSyntheticConfig(config) || isSyntheticRebaseConfig(config)) {
} else if (isSyntheticConfig(config)) {
return [config.totalSupply, config.name, config.symbol, ...defaultArgs];
} else if (isSyntheticRebaseConfig(config)) {
return [0, config.name, config.symbol, ...defaultArgs];
} else {
throw new Error('Unknown collateral type when initializing arguments');
}
Expand Down
7 changes: 5 additions & 2 deletions typescript/sdk/src/token/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ export const NativeConfigSchema = TokenMetadataSchema.partial().extend({
type: z.enum([TokenType.native, TokenType.nativeScaled]),
});

export const CollateralRebaseConfigSchema =
TokenMetadataSchema.partial().extend({
export const CollateralRebaseConfigSchema = TokenMetadataSchema.omit({
totalSupply: true,
})
.partial()
.extend({
type: z.literal(TokenType.collateralVaultRebase),
});

Expand Down

0 comments on commit c6134d7

Please sign in to comment.