Skip to main content

Advanced Patterns

The three preceding pages cover the basics: plain inbound, plain outbound, and the round-trip with auto back-leg. This page is the full reference for every contract-initiated pattern we have built, including five advanced ones that combine funds bridging, state machines, and multi-chain cascades.

Each entry links to a focused, single-purpose example in the Push Chain Examples Repository under contract-initiated-*.

Each example is self-contained: contract, runner, README, .env.sample, and a verified end-to-end run on Donut Testnet.

All patterns

PatternWhat it shows
1. Plain InboundTrigger a state change on Push Chain from a smart contract on an external chain. The Push target sees the dispatching contract's UEA as msg.sender, so on-Push logic can attribute the call to a real external identity.
Tutorial
2. Plain OutboundRun code on an external chain from a Push Chain contract without any live user driving the transaction. The destination sees the contract's CEA as msg.sender, so destination protocols can whitelist or pre-fund that CEA.
Tutorial
3. Round-Trip with Auto Back-LegDispatch to an external chain and automatically receive the result back on Push from a single user signature. No off-chain orchestration, no separate inbound trigger.
Tutorial
4. Recipient BridgeMove native funds from an external chain to a Push wallet straight from contract logic. No payload, no contract call on Push, just a bridged balance bump for the recipient.
5. Inbound With FundsBridge funds AND run a contract call on Push in the same transaction. The classic deposit-and-act pattern: a vault credits the depositor and runs business logic atomically with the funds arriving.
6. Outbound With FundsBridge funds AND run a contract call on the destination chain in the same transaction. Symmetric to inbound-with-funds: pay an external protocol and trigger its action in one atomic move.
7. Round-Trip with ResultModel a round-trip as a request-response on Push. A user opens a request; the destination chain performs the work; the result lands back on Push and resolves the original request. Useful for oracle-style flows where Push waits on external execution.
8. Cross-Chain CascadeOne Push transaction fans out across multiple external chains in sequence. State changes land on two different external networks from a single user signature, with no off-chain glue between hops.