Programmatically enabling "executeSignatures" on home AMB side

We have a transaction on the home side that we want to transfer to the foreign side :

We can finalize the transfer from the home side back to the foreign side manually here :

We did it and it was successful :

We would like to do this programmatically but do not know where to get the parameters for the executeSignatures function [ executeSignatures(bytes _data, bytes _signatures) ].

We looked at the AMB Oracle code :

but still do not understand how or where the “_data” and “_signatures” are coming from.

Are they coming from the payload of an event from the home side AMB? Any help or insight would be greatly appreciated. Our goal is to make it easier for users to navigate back and forth from main net to xdai chain.


authorityResponsibleForRelay, messageHash and NumberOfCollectedSignatures are emitted as part of the CollectedSignatures event:

Where you can see the messageHash argument is calculated as keccak256 of the message signed by the oracles:

You can find that the message comes from the UserRequestForSignature event and signed by the oracle:

The event UserRequestForSignature specifies the encoded data prepared by AMB contract as the message: This message contains the message header and the encoded call of the OmniBridge contract on the Ethereum Mainnet.

The simplest way to get signatures is to iterate through the range from 0 till NumberOfCollectedSignatures-1 and call the method signature of AMB contract for every index of the iteration:

1 Like