Prerequisites
- Node 24 or later
npm install --save-exact @eco-incorp/sauce@0.99.4; the compiler comes with itviemfor chain reads and address formatting- Access to Sauce, which is closed access: contact Eco
1
Build the intent
Base(body, options).reward(reward) compiles the body for Base and packages it as an Eco intent. The body is read as source and compiled, not run as JavaScript, so it captures nothing: every external value goes through defines. Route assets delivered by the solver arrive in the Portal’s Executor, and the program spends from the Pot, so a precalls transfer moves them across first.first-intent.ts
route.deadline bounds fulfillment on the destination; reward.deadline is when the source funds become refundable, so leave room for fulfillment and proof delivery. The source reward must cover the solver’s delivery, fees and gas; the SDK does not price it.2
Prepare the destination Pot and fee
A direct intent route executes through a Pot owned by the destination Portal’s Executor. Any other owner rejects the call with Pass the returned
NotOwner(). Every cook also pays the Kitchen’s current executionFee() in native value, including programs that move only ERC-20s. This helper, from the SDK examples, reads the Executor, resolves the release Kitchen and engine, predicts the Pot, returns a deployment request when the Pot does not exist yet, and quotes the fee.evm-execution.ts
pot, engine and executionFee to buildTransferIntent only when ready is true. Set execution.value to the fee plus any native value the program spends, and budget nativeAmount for every call value in the route. Read the fee shortly before building: Eco can change it per chain, and an increase can make the cook revert or reduce the native value available to the program.A Pot owned by the Executor can be called by routes through that Portal. Deliver assets, use them and return leftovers within the same fulfillment; do not leave funds or allowances in it.3
Fund on the source chain
{ to, data, value }. Send them from the funder on built.source, in order: the approvals authorize the source Portal to pull the reward into the intent vault, and publishAndFundCalldata(false) publishes and fully funds the intent. built.hash() returns the intent, route and reward hashes, and built.vaultCall(), hashCall() and fundedCall() return source-chain read requests with decoders. A solver then fulfills the intent on Base, where the Executor runs your program through the Pot.4
Run a program directly
Outside an intent, compile with the SDK’s compiler export and call Simulate the complete call and estimate gas with your destination RPC before submitting. The Kitchen fee is separate from network gas.Deploy your own Pot once with
cook on a Pot you own. The compiled program is reusable; main arguments are ABI-encoded and appended per execution.Kitchen.deployPot(owner, salt); cook is owner-only. Standalone programs use compiler-native syntax, so contract calls need an ABI import such as ERC20.at(token).approve(...) rather than the SDK’s USDC globals. See Compiler API for options such as compactArgs.Solana
Solana programs compile withtarget: "svm" and return an account manifest that names the accounts to attach. Execution goes through the SDK’s Kitchen client with the released program ids. The client derives a Pot for its payer and resolves accounts against the manifest. Use simulate before sending; maxExecutionFee caps the lamports accepted for the Kitchen fee and defaults to zero, so set it from the Kitchen’s fee configuration.
Solana(body, ...), buildSauceSvmCall) emit a legacy instruction that the released engine does not accept, so do not distribute them as executable intents. The SDK’s Solana guide covers account resolution, fee reads and staging larger programs.
Troubleshooting
Next steps
Programs as intents
Intent options, token and protocol globals, builders, nested intents.
SauceScript reference
The language: types, control flow, contract calls, builtins.
Cookbook
Complete programs shipped in the packages.
