Field notes / Smart contracts

Plan the contract before the code.

The most useful early work is making the rules explicit. Use this guide to prepare a brief your product team, engineers and reviewers can share.

By TanukiLabsProject planning

1. Describe the actions and outcomes.

Start with the actions the product allows. For each one, write who can initiate it, what needs to be true beforehand and what should change afterwards. Keep this description understandable without reading Solidity.

Include actions that must fail. A specification is incomplete if it describes a successful withdrawal but leaves out what should happen when the balance is insufficient or an integration is unavailable. These rules become the basis for implementation and tests.

2. Make permissions visible.

List every privileged action. Who can change a setting, pause an operation or deploy an upgrade? What does that power allow, and how is it controlled? Treat these as product decisions rather than implementation details.

Agree who will hold those responsibilities after launch. The engineering team needs a clear ownership model to prepare deployment and handover instructions. Avoid making an individual’s temporary development access the unexamined production setup.

3. Map what the contracts depend on.

A contract can rely on other contracts, data sources and application services. Document the expected behaviour of each dependency and what the product should do when it is unavailable or behaves differently than expected.

For the app team, include what needs to appear before, during and after a transaction. People need feedback for pending and unsuccessful actions as well as successful ones. A contract interface alone does not describe the whole user experience.

4. Agree on what will be tested.

Turn the specification into a test plan. Identify the properties that must remain true, access restrictions, boundary conditions and external interactions that need coverage. The important cases come from the product’s rules and assumptions.

Keep the tests and documentation useful to another engineer. A future change should come with a way to check that the existing rules still hold. Code, tests and the specification need to stay consistent as the scope evolves.

5. Plan review before setting a launch date.

If the project needs an independent audit, define its scope and reserve time for findings and follow-up work. A review window is not the same as a launch deadline. Changes made afterwards may need another review.

Audit preparation and an independent audit are different services. Agree who is responsible for each, which version is reviewed and how the reviewed code maps to the deployment. No review can guarantee that software is free of bugs.

6. Decide what happens after deployment.

Before release, agree who operates the product, watches for problems and decides how to respond. Deployment instructions should cover the intended environment, permissions and any required configuration.

A useful handover leaves the team with the source code, tests, current documentation and a clear record of what was deployed. If ongoing support is needed, define it as part of the project rather than assuming it will happen automatically.

A good starting brief contains the main actions, permissions, dependencies and launch constraints. You can bring open questions too. Resolving them is part of planning the project.

Let’s talk

Discuss your contract plan

Tell us about your idea, how far you’ve got
and what you need help with. A few lines is a good start.