Cross chain contract between eth and polygon

I've been reading through the cross chain documentation but there's something I don't understand. For polygon the only specialization available is CrossChainEnabledPolygonChild and contracts using it should be deployed to polygon. So what get's deployed to ETH?

In the example (which uses optimism), the abstract contract is created, then we specialize with CrossChainEnabledOptimism. The result is deployed on ETH and the Optimism cross domain messenger handles the rest.

Could someone please explain what the architecture for polygon would look like? I like having the abstract contract - the work I'm doing will require messaging between several chains and it's a good way to avoid repetition of code.

Hello @jcampbell

Unfortunatelly, Polygon does not provide a generic message passing bridge. This means that each contract has to rebuild its own (almost from scratch).

In the ETH → polygon direction, there are some tools available onchain. When calling the "sender contract" on ETH, a very specific tx is produced on Polygon that CrossChainEnabledPolygonChild can process.

For polygon → ETH, the process is to emit an event on polygon, and use some dedicated tolling to prove the event was emitted and react to it. To do so, I'll need to use @maticnetwork/fx-portal/contracts/tunnel/FxBaseRootTunnel.sol, and some javascript code from @maticnetwork/maticjs.

Here is an example of such a contract (unaudited prototype):

I also want to have both eth and matic
First: _baseURI() do i leave blank, put parent hash (from alchemy) there or something else?
Have contract and looking at your sample and the other docs where the child hash would go. Definitely want to deploy both at same time!
Thx for the help. First post here. Looks like a great resource!