TernEscrow holds deposits for cross-chain swaps, TernSwap runs same-chain swaps, and TernPrivateSwap runs private swaps on Starknet. None of them has an owner, a pause switch, or an upgrade mechanism, so these addresses never change and nobody can change what the code does.
Hard-code these addresses in your app instead of reading them from the API:
GET /v1/chainslists each chain’sTernEscrowaddress. If it ever shows a different one, don’t use it.- A firm quote’s transactions should only approve the token being sold to these contracts and then call them. Don’t let the user sign anything else.
Mainnet
Base, Arbitrum, Ethereum, and BNB Chain
Each contract has the same address on all four chains.TernSwapExecutor is a helper that only TernSwap can use. DepositForwarder is the template behind every deposit address.
Starknet
TernEscrow and TernSwap have the same addresses on Starknet mainnet and Sepolia. The class hashes identify the exact code behind each contract.
Private swaps also go through Starknet’s privacy pool (STRK20), which isn’t a Tern contract:
0x040337b1af3c663e86e333bab5a4b28da8d4652a15a69beee2b677776ffe812a on mainnet. Hard-code it alongside TernPrivateSwap to check private swaps.
Testnet
The EVM testnet addresses differ from mainnet’s.
Checking a deployment
- EVM:
TernEscrow’s code is identical on all four chains, apart from two values tied to the chain’s ID. You can compare it across chains witheth_getCode. - Starknet:
starknet_getClassHashAtreturns each contract’s class hash, which should match the table above.