Cross-chain Execution using Defenders

Is there a way to enable cross-chain call in single script on OZ Defenders ?

Example: I want to read value of X from a contract on chain A and use the received value of X to trigger a transaction on chain B.

1 Like

you can make it offchain, where from offchain code, you call chain A, and when you receive result, you can trigger the chain B.

Yes, it can be done using off-chain code but I was wondering if this could be done using defenders.
Don't want an added variable to the system :sweat_smile:

Hi @N08ITA ,

Yes, within an Autotask you could:

  1. Read a property from Ethereum Mainnet (using either a Defender Relay Provider or configuring your own provider)

  2. Use a Relayer on BSC to make the function call using the Relay API

Note that if you do choose to configure a Defender Relay Provider in #1 above, assigning one Relayer to an Autotask can be done easily while setting up the Autotask, but configuring the second Relayer will require you storing the Relayer API Key in the Autotask Secrets Store and using those credentials when you instantiate the Relay Client.

Hope that's helpful

1 Like