Contract IDE¶
The Contract IDE is where developers write contracts, compile them, review them, and publish them — with security review in the same workspace rather than a stage you reach at the end.
Open Trilocore, select the project you want to work on, and choose Contract IDE. Check whether you are editing a local tree or a shared project before making changes. Local editing state and a committed workspace revision are different records.
Build and test in the app¶
- Open a file or choose a template, then select the entry file to compile.
- Open Compile & Deploy, choose compiler settings, and select Compile.
- Resolve the reported errors and inspect the resulting contract artifact.
- Open the intended fork session, check its network, and deploy the selected artifact with the required constructor arguments.
- Call the deployed contract and review the return data, transaction result and recorded state changes. Continue in the Auditing IDE when you need a deeper execution review.
If source or compiler settings change, recompile before deploying. The IDE marks an older build explicitly; Deploy older build is an intentional choice to test that previous artifact. A failed build does not make the last successful build a valid result for the new source.
Fork deployment tests the contract on the selected private state. It does not publish a contract to the live network.
Create a shared workspace through the API¶
Shared workspaces support files, commits, branches, reviews and publishing.
curl -X POST https://api.trilocore.ai/api/v1/ide/workspaces \
-H "Authorization: Bearer $TRILOCORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "my-protocol"}'
Or start from a template instead of an empty repo — list what is available with
GET /api/v1/ide/templates, then scaffold into the workspace with
POST /api/v1/ide/workspaces/{uuid}/scaffold. Scaffolding creates ordinary
commits, so a template arrives as real history, not as untracked files.
Reference: Workspaces and files.
Files and branches¶
Files are addressed by path within the workspace:
curl -X PUT https://api.trilocore.ai/api/v1/ide/workspaces/{uuid}/files/{rest} \
-H "Authorization: Bearer $TRILOCORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n"}'
Every write is a commit. Alongside the committed tree there is a draft area for work in progress, so an editor can save continuously without turning every keystroke into history.
Because it is git underneath, the rest follows: create and delete branches, set branch protection, tag releases. Protection is enforced server-side, so a protected branch cannot be bypassed by a client that decides not to ask.
Compile¶
Compilation is asynchronous. Submit the job, then poll it:
curl -X POST https://api.trilocore.ai/api/v1/ide/compile \
-H "Authorization: Bearer $TRILOCORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"workspace_id": "…", "toolchain": "forge"}'
curl -X GET https://api.trilocore.ai/api/v1/ide/compile/jobs/{id} \
-H "Authorization: Bearer $TRILOCORE_API_KEY"
GET /api/v1/ide/workspaces/{uuid}/languages reports what the workspace looks
like — which languages were detected and which toolchain will be selected — and
GET /api/v1/ide/toolchains lists the toolchains available for hosted builds.
Choose the correct build workflow¶
| Goal | Workflow | Check before continuing |
|---|---|---|
| Compile Solidity in the IDE | Compile & Deploy with an EVM session | Entry file, compiler version, optimization settings and selected artifact. |
| Build a shared Solidity or Vyper workspace | Hosted compile job | The toolchains offered by the service and the job's diagnostics. |
| Build a Solana Rust program | Open a Solana session, choose a template and Build program | Builder availability and source diagnostics. |
| Test an existing Solana program binary | Upload .so, then deploy to the Solana fork | An uploaded binary is not verified as a build of the current source. |
| Build an arbitrary Rust crate through the shared-workspace compiler | Capability-dependent hosted build | Language detection does not establish that a hosted Rust build is enabled. |
For a Solana program, Compile & Deploy follows the open Solana session. Choose the template, provide a program name, and use Build program or Upload .so. Review build diagnostics and the source-verification status, then deploy to that session's fork. A Builder unavailable message is a failed or unavailable build path, not a successful compile. See Solana sessions and programs.
The hosted shared-workspace Rust compiler and the Solana program workflow are
separate capabilities. Use the build controls and capability response for your
session rather than assuming support from a .rs filename.
Diagnostics come back in one normalized shape regardless of the compiler — severity, file, line, column, code, message — so tooling built against one language keeps working for the next.
Reference: Compilation and integrations.
Compiler output
The compile job reports success, diagnostics and a manifest of what was built. Direct download of the produced artifact is not yet exposed through the public API.
Review¶
Review is a first-class part of the workspace, not a GitHub round trip.
- Merge requests — open one between branches, comment on it, record reviews, attach status checks, and merge when they pass.
- Annotations — attach a note to a specific place in the code, thread comments under it, and move it through a status. This is the seam between the two IDEs: something found in an audit becomes an annotation on the exact line that caused it.
- Audits — a workspace audit collects annotations and findings, exposes the tree and blob at the reviewed revision, holds evidence, and closes with a status.
Findings can be exported as SARIF, per workspace or per audit, which is what a code-scanning integration consumes.
Reference: Review, audits and evidence.
Evidence¶
Evidence is the auditable half of a review: an artifact attached to an audit, signable, verifiable, and subject to a retention policy. Signing produces a record that the evidence existed in that exact form at that time; verification re-checks it later. Retention is explicit, so nothing is silently discarded and nothing is silently kept forever.
Publish to GitHub¶
Because a workspace is a git repo, publishing is a genuine push of the full commit history — not a snapshot export. Connect the repository once, then push:
curl -X POST https://api.trilocore.ai/api/v1/ide/workspaces/{uuid}/github/publish \
-H "Authorization: Bearer $TRILOCORE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'
The connection is owner-only and its token is stored encrypted; a publish
pushes only to the repository you connected. Publishing is a mutating call and requires an
Idempotency-Key — as does
POST /api/v1/ide/workspaces/{uuid}/bindings/push.
Members and access¶
Workspace membership is explicit, with roles that decide who can write, who can merge, and who can administer the connection to GitHub. The workspace audit log records what was done and by whom.
Where this meets the Auditing IDE¶
The Contract IDE and the Auditing IDE share a workspace. In practice that means:
- A contract you are writing can be compiled here and then examined on a fork in the Auditing IDE.
- A finding raised against a deployed contract can come back as an annotation on the line responsible, tracked to a status.
- Both trails land in the same workspace activity, so the record of an engagement is one story rather than two.
Next: Core concepts for workspaces, projects and findings, or the Endpoint reference for everything above in detail.