0

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.

1 Answer 1

3

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.

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 ) so that you can reduce the script size and have a clue of what's going on in your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.