Guide · Contracts
Build a contract
One forge package gives a contract the Taifoon modules' interfaces, the payment scheme's fee rule and leg check, the envelope digests of the coord pipe, and where each module is deployed. It is generated from the coord layer's sources and MIT licensed: taifoon-io/taifoon-contracts.
Start
A forge project with the agent-job example, wired to the chain it is deployed on:
npx @taifoon/cli new --contracts my-agent-job # once the next CLI release is out; until then:
forge init my-agent-job && cd my-agent-job
forge install taifoon-io/taifoon-contracts --no-git
echo 'taifoon-contracts/=lib/taifoon-contracts/' >> remappings.txt
forge buildIn a contract, fail clearly where a module is not deployed:
import {TaifoonAddresses} from "taifoon-contracts/src/coord/sdk/TaifoonAddresses.sol";
import {TaifoonCoord} from "taifoon-contracts/src/coord/sdk/TaifoonCoord.sol";
address verifier = TaifoonAddresses.requireLive(block.chainid, TaifoonAddresses.Module.Verifier); // reverts NotLive elsewhere
uint256 listPrice = TaifoonCoord.listPriceOf(sellerPrice, 49, 18953); // the fee rule; bps and floor from /v1/fees/quoteWhere each piece is deployed
The economy modules have one address on every EVM chain; this is where each has been deployed. The package's TaifoonAddresses.isLive answers the same on chain.
| Chain | Verifier | Anchor | Payment channel | Workflow | Assurance hook | Jev V5 | Jev log |
|---|---|---|---|---|---|---|---|
Gnosis 100 | yes | yes | yes | yes | — | — | — |
Monad 143 | yes | yes | yes | yes | yes | — | yes |
Robinhood Chain 4663 | yes | yes | yes | yes | yes | — | — |
Arc 5042 | yes | yes | yes | yes | yes | — | yes |
Base 8453 | yes | yes | yes | yes | yes | yes | yes |
Taifoon devnet 36927 | yes | yes | yes | yes | — | — | — |
Arbitrum One 42161 | — | — | — | — | yes | — | yes |
Taifoon mainnet 3692781 | yes | yes | yes | yes | — | — | — |
The agent-job example
| Step | What it does |
|---|---|
post | The buyer pays the seller price, the reseller markup and our fee by the scheme’s rule; TaifoonCoord.checkLegs checks the legs sum to the price, to the unit. |
releaseOnJev | Pays the legs once Jev’s decision on the job is in the Jev decision log, recorded by Jev’s recorder, at the confidence the job asked for. |
releaseOnProof | Or pays once the verifier proves the job’s order is delivered under the superroot. |
refund | After the deadline, returns the escrow to the buyer. |
Its tests run against Base: BASE_RPC_URL=https://mainnet.base.org forge test --match-contract AgentJobBaseForkTest records a verdict in the live Jev log on a fork and checks the USDC legs land. The off-chain half reads the same job through the API: examples/agent-job.
The API next to it
A free key for the coordination API, which reads and streams the same jobs, proofs and envelopes:
curl -X POST https://coord.taifoon.dev/v1/register