Skip to content

Commit

Permalink
Inject config at build time with .env files AxLabs#2
Browse files Browse the repository at this point in the history
  • Loading branch information
vczb committed Oct 21, 2021
1 parent 8dd429e commit 7e56435
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ cd my-project-name
npm install
```

Open .env.local and set the environment variables

```
NEXT_PUBLIC_MEME_CONTRACT_HASH=0x3298f0592ad719084518850eb7147cebb1564dd2
NEXT_PUBLIC_MEME_GOVERNANCE_CONTRACT_HASH=0x7ab855b7a0d798e9a14221b5eca55a358c1f0573
```

Then, you can run **locally** in **development mode with live reload**:

```
Expand Down
3 changes: 1 addition & 2 deletions src/contracts/MemeContract.ts
Original file line number Diff line number Diff line change
@@ -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[];
Expand Down
3 changes: 1 addition & 2 deletions src/contracts/MemeGovernanceContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];
Expand Down

0 comments on commit 7e56435

Please sign in to comment.