Skip to main content

Add chain contracts

A Gora app can be off-chain only, but many apps also need a chain contract, gateway, program, or smart wallet. Use a chain contract when you need to:
  • verify a Gora result or attestation on-chain
  • hold app state
  • execute transfers or callbacks
  • enforce replay protection
  • connect mobile/user signatures to chain execution

Key rule

gora deploy deploys your Gora app package. It does not deploy Base contracts, Solana programs, or Algorand applications. Use gora contract ... for chain contract metadata:
Then deploy the app package:

Local developer vs Devnet operator

If you are developing from your local computer, prefer --node:
This asks the Gora Devnet endpoint for already deployed chain metadata and records it locally. If you are the Devnet operator on the VM, you may deploy directly using local chain files and tools, such as Algorand --datadir.

Contract metadata endpoint

Gora Devnet exposes chain metadata at:
Example Algorand response:
The CLI uses the same endpoint when you run gora contract deploy --node ....

Diagnose setup

Run doctor before deploying:
Doctor checks local source/build/deploy receipts and remote contract metadata when a node URL is provided.

Base/EVM

Build metadata:
Resolve the Devnet gateway or contract address:
Or record a known address manually:
Link it into the manifest:

Solana

Build metadata and default source scaffold:
Resolve the Devnet program id:
Or record a known program id:
Link it:

Algorand

Build gateway TEAL metadata:
Normal local developer flow:
This records the deployed Algorand app_id from Gora Devnet. VM/operator direct deploy flow:
--datadir must point to a local Algorand Node/ directory containing algod.net and algod.token. It only works on the machine running that Algorand localnet. Manual record-existing flow:

What linking writes

gora contract link --chain <chain> updates gora.app.json with a contract binding similar to:
After linking, run:

Custom fulfillment contracts

For custom EVM contracts, prefer a gateway-mediated callback. The custom contract should accept calls only from the trusted Gora gateway and reject duplicate request ids. Minimal interface:
Your contract should verify:
  • caller is the trusted gateway
  • request id was not already fulfilled
  • app id matches your app
  • output hash matches the supplied result
  • proof/attestation was accepted by the gateway
  • decoded result satisfies your policy limits
Next: Set policy and payments.