Best practice for contract debugging?


I’ve prepared first draft of an smart contract on Flow. Now I need to deploy and debug it (on emulator locally I guess). I tried it with Flow Playground web client first. But it does not match my requirements. It does not support to retrieve a timestamp from a recent bock being published.

Please advise what is the best practice to do this: VSCode, Flow CLI, anything else?

Also what is the common scenario how to deploy → debug → fix → redeploy → etc - any instruction would be helpful.

Thanks in advance,

I would recommend writing automated tests for it with the emulator
If you are using javascript, here is a work in progress js testing framework: GitHub - onflow/flow-js-testing: Testing framework to enable Cadence testing via a set of JavaScript methods and tools

if you are using Go, there isn’t anything super great yet, but the tools I use are in here with the SDK if you want to try them out. They aren’t well documented though, but I am working on it: flow-core-contracts/lib/go at master · onflow/flow-core-contracts · GitHub

1 Like