Skip to content
Thyme Docs

Build Your First Contract Task

Use the quickstart first to confirm your toolchain with an inert heartbeat. This tutorial turns that workflow into a contract update using a deployed contract you control.

Prepare the contract and account

Choose an enabled testnet and a contract exposing value() and setValue(uint256). Know its deployed address and ABI, and grant any contract-level authorization required by its setter to the profile's customer Safe. A Roles allowlist does not bypass a target contract's own access control.

Complete a Roles profile where available. Its rule should cover only your contract and setValue(uint256). A run may return several calls; the Roles route executes them atomically in one transaction, and every call must be covered by the profile's rules.

Implement and validate locally

Create the task from authoring a task, saving its manifest after the local checks below. CLI 0.10.0 has a known local manifest-loading bug. Enter the contract address and desired decimal value in args.json; configure RPC_URL and the profile address as SIMULATE_ACCOUNT.

thyme run update-value
thyme run update-value --simulate
thyme run update-value --simulate-callbacks

Inspect the encoded call and logs. A task skip when the value already matches is expected. Simulation does not authorize or broadcast the returned transaction.

Upload and bind

Now save the example permissions.json beside the task. Upload validates and includes it in the release.

thyme upload update-value --tag v1

Create an executable using that release, the same chain/profile, and the desired cloud args. The manifest must be covered by the profile's active scope. Local args and storage do not seed the cloud executable automatically.

Observe the first real run

Use Execute now when ready. Inspect the execution's function version, profile, transaction hash, and confirmation state. After confirmation, the example's onSuccess writes the last transaction and value into cloud storage.

Run it again: if the contract already has the requested value, it should skip without another transaction. This on-chain state check makes ordinary repeated invocations safer than relying solely on a local counter.

Release a change

Upload a new tag, pause the executable, review any new permissions and args, then switch releases. Never assume uploading a newer version updates a running executable.