# Hardcoded canister principals

**URL:** https://forum.dfinity.org/t/hardcoded-canister-principals/19999
**Category:** Motoko
**Created:** [May 15, 2023, 12:43pm UTC](https://forum.dfinity.org/t/hardcoded-canister-principals/19999 "2023-05-15T12:43:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)
#### Post date: [May 15, 2023, 12:43pm UTC](https://forum.dfinity.org/t/hardcoded-canister-principals/19999/1 "2023-05-15T12:43:20Z")

</div>

I currently have a canister address hardcoded:

```auto
  let nativeIPCToken = "ryjl3-tyaaa-aaaaa-aaaba-cai"; // native NNS ICP token.

```

But how to debug this?

So, I have several more questions:

- If I want to substitute a locally compiled canister in “debug mode”, how to do this (maybe, by passing `debug: Bool` to canister initialization? but this seems not to be a very good method). Something like C preprocessor?
- Can I call IC canisters from the live network from my local canisters running on DFX (`dfx start`)? (If no, adding this would be a good feature, I think.)

---

<div class="post-metadata">

### Author: ![Zane](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/zane/32/6541_2.png) [@Zane](https://forum.dfinity.org/u/Zane)
#### Post date: [May 15, 2023, 1:48pm UTC](https://forum.dfinity.org/t/hardcoded-canister-principals/19999/2 "2023-05-15T13:48:27Z")

</div>

1. Relevant discussion: [ENV variables for motoko builds](https://forum.dfinity.org/t/env-variables-for-motoko-builds/11640)  
TLDR; you can use actor classes if your canister doesn’t have init parameters, otherwise a bash script or using MOPS are the only way for now.

2. No you can’t call mainnet from local environment, I remember it was discussed in the past but there were security concerns and Dfinity preferred to go with `dfx pull` as an alternative.
