Docs
Reference
Contract documentation
signal
ISignalService

ISignalService

The SignalService contract serves as a secure cross-chain message passing system. It defines methods for sending and verifying signals with merkle proofs. The trust assumption is that the target chain has secure access to the merkle root (such as Taiko injects it in the anchor transaction). With this, verifying a signal is reduced to simply verifying a merkle proof.

sendSignal

function sendSignal(bytes32 signal) external returns (bytes32 storageSlot)

Send a signal (message) by setting the storage slot to a value of 1.

Parameters

NameTypeDescription
signalbytes32The signal (message) to send.

Return Values

NameTypeDescription
storageSlotbytes32The location in storage where this signal is stored.

isSignalSent

function isSignalSent(address app, bytes32 signal) external view returns (bool)

Verifies if a particular signal has already been sent.

Parameters

NameTypeDescription
appaddressThe address that initiated the signal.
signalbytes32The signal (message) to send.

Return Values

NameTypeDescription
[0]boolTrue if the signal has been sent, otherwise false.

isSignalReceived

function isSignalReceived(uint256 srcChainId, address app, bytes32 signal, bytes proof) external view returns (bool)

Verifies if a signal has been received on the target chain.

Parameters

NameTypeDescription
srcChainIduint256The identifier for the source chain from which the signal originated.
appaddressThe address that initiated the signal.
signalbytes32The signal (message) to send.
proofbytesMerkle proof that the signal was persisted on the source chain.

Return Values

NameTypeDescription
[0]boolTrue if the signal has been received, otherwise false.