Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blast card and deployment #6955

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions libs/core/src/commonProtocol/chainConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export enum ValidChains {
Base = 8453,
SepoliaBase = 84532,
Sepolia = 11155111,
Blast = 81457,
}

export const STAKE_ID = 2;
Expand All @@ -25,6 +26,11 @@ export const factoryContracts: {
communityStake: '0xd097926d8765A7717206559E7d19EECCbBa68c18',
chainId: 84532,
},
[ValidChains.Blast]: {
factory: '0xedf43C919f59900C82d963E99d822dA3F95575EA',
communityStake: '0xcc752fd15A7Dd0d5301b6A626316E7211352Cf62',
chainId: 81457,
},
[ValidChains.Base]: {
factory: '0xedf43C919f59900C82d963E99d822dA3F95575EA',
communityStake: '0xcc752fd15A7Dd0d5301b6A626316E7211352Cf62',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ChainBase } from '@hicommonwealth/core';
import './CWCommunitySelector.scss';

export enum CommunityType {
Blast = 'blast',
Ethereum = 'ethereum',
Cosmos = 'cosmos',
Polygon = 'polygon',
Expand All @@ -28,6 +29,9 @@ interface CWCommunitySelectorProps {
onClick: () => void;
}

const BLAST_LOGO =
'https://assets-global.website-files.com/65a6baa1a3f8ed336f415cb4/65a6c39bae6093c6653dd016_Logo%20Yellow%20on%20Black%20Background%202x-p-500.png';

const CWCommunitySelector = ({
type,
title,
Expand All @@ -38,7 +42,14 @@ const CWCommunitySelector = ({
return (
<div className={ComponentType.CommunitySelector} onClick={onClick}>
<div className="chain-logo-container">
<img src={`/static/img/communitySelector/${type}.svg`} alt={title} />
<img
src={
type === CommunityType.Blast
? BLAST_LOGO
: `/static/img/communitySelector/${type}.svg`
}
alt={title}
/>
</div>
<div className="content-container">
<div className="title-row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { useBrowserAnalyticsTrack } from '../../../../../../hooks/useBrowserAnal
import './BasicInformationForm.scss';
import {
BASE_ID,
BLAST_ID,
OSMOSIS_ID,
POLYGON_ETH_CHAIN_ID,
existingCommunityIds,
Expand Down Expand Up @@ -119,6 +120,10 @@ const BasicInformationForm = ({
return {
chain: getChainOptions()?.find((o) => o.value === OSMOSIS_ID),
};
case CommunityType.Blast:
return {
chain: getChainOptions()?.find((o) => o.value === BLAST_ID),
};
case CommunityType.Polygon:
case CommunityType.Solana:
return { chain: getChainOptions()?.[0] };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const POLYGON_ETH_CHAIN_ID = 137;
export const ETHEREUM_MAINNET_ID = '1';
export const BASE_ID = '8453';
export const OSMOSIS_ID = 'osmosis';
export const BLAST_ID = '81457';

export const existingCommunityIds = app.config.chains
.getAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ const CommunityTypeStep = ({
handleContinue();
};

const [ethereumOption, ...advancedOptions] = communityTypeOptions;
const [blastOption, ethereumOption, ...advancedOptions] =
communityTypeOptions;

return (
<div className="CommunityTypeStep">
Expand All @@ -89,21 +90,35 @@ const CommunityTypeStep = ({
a community. Members must also have a compatible wallet type to join
your community.
</CWText>

<CWCommunitySelector
key={ethereumOption.type}
type={ethereumOption.type}
title={ethereumOption.title}
description={ethereumOption.description}
isRecommended={ethereumOption.isRecommended}
onClick={() =>
handleCommunitySelection({
type: ethereumOption.type,
chainBase: ethereumOption.chainBase,
})
}
/>

<div className="advanced-options-container">
jnaviask marked this conversation as resolved.
Show resolved Hide resolved
<CWCommunitySelector
key={blastOption.type}
type={blastOption.type}
title={blastOption.title}
description={blastOption.description}
isRecommended={true}
onClick={() =>
handleCommunitySelection({
type: blastOption.type,
chainBase: ethereumOption.chainBase,
})
}
/>

<CWCommunitySelector
key={ethereumOption.type}
type={ethereumOption.type}
title={ethereumOption.title}
description={ethereumOption.description}
isRecommended={false}
onClick={() =>
handleCommunitySelection({
type: ethereumOption.type,
chainBase: ethereumOption.chainBase,
})
}
/>
</div>
<div className="advanced-options-container">
<CWText type="h4">Advanced Options</CWText>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ import { ChainBase } from '@hicommonwealth/core';
import { CommunityType } from 'views/components/component_kit/new_designs/CWCommunitySelector';

export const communityTypeOptions = [
{
type: CommunityType.Blast,
chainBase: ChainBase.Ethereum,
title: 'Blast',
isRecommended: true,
description:
'Blast is an Ethereum Layer 2 network with high TVL, offering native yield,' +
'and secure decentralized app platform.',
},

{
type: CommunityType.Ethereum,
chainBase: ChainBase.Ethereum,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const useCreateCommunity = () => {
);
const showCommunityStakeStep =
isValidStepToShowCommunityStakeFormStep &&
selectedCommunity.type === 'ethereum' &&
(selectedCommunity.type === 'ethereum' ||
selectedCommunity.type === 'blast') &&
isEthereumMainnetSelected;

return {
Expand Down
Loading