Helicon Upgrade hits Mainnet September 22.Mainnet September 22Read more

Example Contracts

The Solidity contracts the harness tests and demo scripts use

The example contracts live under contracts/src/examples/ — a Foundry project with icm-contracts v1.0.9 pinned, compiled with Solidity 0.8.25. They're the building blocks the harness tests and the demo scripts use, and a good starting point for your own contracts.

Layout

DirectoryContracts
icm-basics/SimpleSender + SimpleReceiver — minimal ICM send/receive
ictt-erc20/ERC-20 round-trip + DemoERC20
ictt-native/Native token home/remote bridge
teleporter-patterns/PingPong + CrossChainCounter

Each example has matching harness tests under contracts/test/examples/.

Build Configuration

The Foundry config (contracts/foundry.toml) pins the toolchain so builds are reproducible:

SettingValue
solc_version0.8.25
evm_versionshanghai
optimizer_runs200
libslib, ../packages/harness

Dependencies are not vendored

contracts/lib/ is not committed to the repo and pnpm install does not populate it. Install the Foundry dependencies (forge-std, OpenZeppelin, icm-contracts) per Installation before building or testing.

Building

forge build --root contracts

This writes artifacts to contracts/out/<Name>.sol/<Name>.json, which loadArtifact() reads at runtime.

Next Steps

Is this guide helpful?

On this page

Page Actions

Edit on GitHubReport Issue