Skip to main content
Short programs that each show one part of the language. The first is from the compiler’s introduction; the rest ship as example sources under dev-tools/sauce/ts/ inside @eco-incorp/sauce. Compile them with @eco-incorp/sauce/compiler and run them through your Pot as in Getting started; the package’s older local-network scripts under dev-tools/scripts target an earlier contract interface and are not compatible with current deployments.

Prerequisites

Complete Sauce setup and use the documented SDK and compiler versions. For execution, confirm the target deployment, Pot ownership, balances and Kitchen fee. Simulate the complete transaction and estimate its gas before submitting it.

Conditional native transfer

Send native value to the supplied recipient only if the Pot holds enough.

Arithmetic with an input check

example.ts

Addition

add.ts

Contract call: Uniswap V3 factory lookup

Imports the factory ABI from an npm package and looks up a pool address.
call.ts
The three main parameters (factory, token0, token1) arrive as ABI-encoded arguments appended to the compiled program. The import resolves through the compiler’s resolvePackage hook, so @uniswap/v3-core must be installed in the project that compiles it.

ERC-20-like transfer: storage, crypto, ABI encoding and events

erc20.ts

Fibonacci: loops and locals

fibonacci.ts

Troubleshooting

If an import cannot be resolved, check your resolver and installed ABI package. EVM-specific calls and storage builtins in these examples require target: "evm". Arithmetic overflow or a failed require or throw condition reverts execution.

Next steps

Read the SauceScript reference or try the best-pool swap.