From 5ba73793f66edaa5888de472fb124e9f652f8bf8 Mon Sep 17 00:00:00 2001 From: Vinicius Zucatti Date: Thu, 21 Oct 2021 20:21:12 -0300 Subject: [PATCH] Inject config at build time with .env files #2 --- .env | 2 ++ src/contracts/MemeContract.ts | 3 +-- src/contracts/MemeGovernanceContract.ts | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..bd2f5dc --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +NEXT_PUBLIC_MEME_CONTRACT_HASH=0x0f47f2176e1effd4cc5d47cf8dc7178ee30b108e +NEXT_PUBLIC_MEME_GOVERNANCE_CONTRACT_HASH=0x7fd53b2098e0891a02a8a2be2d71ac79f15188f2 diff --git a/src/contracts/MemeContract.ts b/src/contracts/MemeContract.ts index 6ca2a95..4f28800 100644 --- a/src/contracts/MemeContract.ts +++ b/src/contracts/MemeContract.ts @@ -1,8 +1,7 @@ import { NeoLineN3Interface } from '../utils/neoline/neoline'; import { TypedValue } from '../utils/neoline/neoline-model'; -const MEME_CONTRACT_HASH = `0x${'3298f0592ad719084518850eb7147cebb1564dd2'}`; -// const NO_OWNER_ZEROS_BASE64 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAA='; +const MEME_CONTRACT_HASH = process.env.NEXT_PUBLIC_MEME_CONTRACT_HASH || ''; export type MemeContractState = { memes: Meme[]; diff --git a/src/contracts/MemeGovernanceContract.ts b/src/contracts/MemeGovernanceContract.ts index f53f328..419fdab 100644 --- a/src/contracts/MemeGovernanceContract.ts +++ b/src/contracts/MemeGovernanceContract.ts @@ -5,8 +5,7 @@ import { NeoLineN3Interface } from '../utils/neoline/neoline'; import { TypedValue } from '../utils/neoline/neoline-model'; import { fromStackItemToMeme, Meme } from './MemeContract'; -const MEME_GOVERNANCE_CONTRACT_HASH = `0x${'7ab855b7a0d798e9a14221b5eca55a358c1f0573'}`; -// const NO_OWNER_ZEROS_BASE64 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAA='; +const MEME_GOVERNANCE_CONTRACT_HASH = process.env.NEXT_PUBLIC_MEME_GOVERNANCE_CONTRACT_HASH || ''; export function fromStackToMemeGovernanceProposal(stack: TypedValue[]): MemeGovernanceProposal[] { const proposals: MemeGovernanceProposal[] = [];