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

Add mainnet sc index address and modify getSCAddress to support mainnet #217

Merged
merged 1 commit into from
Jan 13, 2025
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
5 changes: 2 additions & 3 deletions cli/src/lib/index/const.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export const BUILDNET_INDEX_ADDRESS =
'AS1TmA4GNpSYBseNNMXpbAp2trUwZxZy3T1sZ9Qd3Qdn9L8wGbMS'

// TODO: Replace with mainnet address when available
export const MAINNET_INDEX_ADDRESS = ''
export const MAINNET_INDEX_ADDRESS =
'AS12UpEfdonZxyFnsmrJfZbXLM3Gq6LaL3hPk7wTXqU4UZfnypKzF'

export const updateWebsiteFunctionName = 'updateWebsite'
4 changes: 2 additions & 2 deletions cli/src/lib/index/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { bytesToStr, CHAIN_ID, SmartContract } from '@massalabs/massa-web3'

import { BUILDNET_INDEX_ADDRESS } from './const'
import { BUILDNET_INDEX_ADDRESS, MAINNET_INDEX_ADDRESS } from './const'

/**
* Get the owner of a website using its 'OWNER' storage key
Expand Down Expand Up @@ -28,7 +28,7 @@ export async function getOwnerFromWebsiteSC(
export function getSCAddress(chainId: bigint): string {
switch (chainId) {
case CHAIN_ID.Mainnet:
throw new Error('Mainnet is not supported yet')
return MAINNET_INDEX_ADDRESS
case CHAIN_ID.Buildnet:
return BUILDNET_INDEX_ADDRESS
default:
Expand Down
Loading