<p>it strictly depends on your needs and how your validator is supposed to work.</p>
<p>traces in general (<code>trace</code>, <code>traceIfFalse</code>, <code>traceIfTrue</code>, <code>traceError</code>) <a href="https://github.com/input-output-hk/plutus/issues/4174" rel="nofollow noreferrer">are known to be one of the causes of larger scripts</a>.</p>
<p>so if your validator has to be used in pair with other data in a transaction it is essential it reduces the script size.</p>
<p>keep in mind that removing traces means you'll likely have a hard time understanding what is wrong if something goes wrong.</p>
<p>one possible solution to keep traces would be to use error codes ( <a href="https://playground.plutus.iohkdev.io/doc/plutus/troubleshooting.html#error-codes" rel="nofollow noreferrer">as done for some errors that might happen when using builtin funcitonalities</a> ) so that you can reduce the script size and have a clue of what's going on in your code.</p>

CC BY-SA 4.0
2022-07-03T18:34:43.657Z
2022-07-03T18:34:43.657Z
Michele Nuzzi
<p>So I use traceIfFalse to test a lot of my smart contracts now I'm ready to deploy some of then and I want to know if this is for development only or if its fine to have a smart contract use this function when deployed to the chain?</p>
<p>Im using it in the validator of the contract.</p>

<haskell><smart-contract><validator>
Can I Use TraceIfFalse in deployment?
# Can I Use TraceIfFalse in deployment?

(Asked by: username_0 on 2022-07-03)

So I use traceIfFalse to test a lot of my smart contracts now I'm ready to deploy some of then and I want to know if this is for development only or if its fine to have a smart contract use this function when deployed to the chain?

Im using it in the validator of the contract.

**Tags:** haskell, smart-contract, validator

---

## 1 answers

### Answer by username_1 on 2022-07-03. Score: 3 | Accepted answer

it strictly depends on your needs and how your validator is supposed to work.

traces in general (`trace`, `traceIfFalse`, `traceIfTrue`, `traceError`) [are known to be one of the causes of larger scripts](https://github.com/input-output-hk/plutus/issues/4174).

so if your validator has to be used in pair with other data in a transaction it is essential it reduces the script size.

keep in mind that removing traces means you'll likely have a hard time understanding what is wrong if something goes wrong.

one possible solution to keep traces would be to use error codes ( [as done for some errors that might happen when using builtin funcitonalities](https://playground.plutus.iohkdev.io/doc/plutus/troubleshooting.html#error-codes) ) so that you can reduce the script size and have a clue of what's going on in your code.


---

