Fetch sg721-updatable code id from env variables

This commit is contained in:
Serkan Reis 2023-04-24 11:09:55 +03:00
parent 03ddc13911
commit 2f681bbcba
3 changed files with 7 additions and 3 deletions

1
env.d.ts vendored
View File

@ -17,6 +17,7 @@ declare namespace NodeJS {
readonly NEXT_PUBLIC_SG721_CODE_ID: string
readonly NEXT_PUBLIC_MINTER_CODE_ID: string
readonly NEXT_PUBLIC_WHITELIST_CODE_ID: string
readonly NEXT_PUBLIC_SG721_UPDATABLE_V1_CODE_ID: string
readonly NEXT_PUBLIC_PINATA_ENDPOINT_URL: string
readonly NEXT_PUBLIC_API_URL: string

View File

@ -21,6 +21,7 @@ import { useEffect, useState } from 'react'
import { toast } from 'react-hot-toast'
import { FaArrowRight } from 'react-icons/fa'
import { useMutation } from 'react-query'
import { SG721_UPDATABLE_V1_CODE_ID } from 'utils/constants'
import { withMetadata } from 'utils/layout'
import { links } from 'utils/links'
@ -38,7 +39,7 @@ const Sg721MigratePage: NextPage = () => {
title: 'Code ID',
subtitle: 'Code ID of the New Sg721 contract',
placeholder: '1',
defaultValue: 47,
defaultValue: SG721_UPDATABLE_V1_CODE_ID,
})
const contractState = useInputState({
@ -107,8 +108,9 @@ const Sg721MigratePage: NextPage = () => {
<NumberInput isRequired {...codeIdState} />
<Alert type="info">
<div className="inline-block">
Migrating a v1 contract to Code ID: 47 (sg721-updatable) will allow the creator to update the royalty
details and token metadata. Once the migration is complete, new functionalities can be performed using{' '}
Migrating a v1 contract to Code ID: {SG721_UPDATABLE_V1_CODE_ID} (sg721-updatable) will allow the creator
to update the royalty details and token metadata. Once the migration is complete, new functionalities can
be performed using{' '}
<Anchor
className="font-bold text-plumbus hover:underline"
external

View File

@ -1,6 +1,7 @@
export const SG721_CODE_ID = parseInt(process.env.NEXT_PUBLIC_SG721_CODE_ID, 10)
export const MINTER_CODE_ID = parseInt(process.env.NEXT_PUBLIC_MINTER_CODE_ID, 10)
export const WHITELIST_CODE_ID = parseInt(process.env.NEXT_PUBLIC_WHITELIST_CODE_ID, 10)
export const SG721_UPDATABLE_V1_CODE_ID = parseInt(process.env.NEXT_PUBLIC_SG721_UPDATABLE_V1_CODE_ID, 10)
export const PINATA_ENDPOINT_URL = process.env.NEXT_PUBLIC_PINATA_ENDPOINT_URL
export const NETWORK = process.env.NEXT_PUBLIC_NETWORK