Skip to main content

SignalService

SignalProof

struct SignalProof {
struct BlockHeader header;
bytes proof;
}

B_ZERO_SIGNAL

error B_ZERO_SIGNAL()

B_NULL_APP_ADDR

error B_NULL_APP_ADDR()

B_WRONG_CHAIN_ID

error B_WRONG_CHAIN_ID()

init

function init(address _addressManager) external

Initializer to be called after being deployed behind a proxy.

sendSignal

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

Send a signal by storing the key with a value of 1.

Parameters

NameTypeDescription
signalbytes32The signal to send.

Return Values

NameTypeDescription
storageSlotbytes32The slot in storage that this signal is persisted.

isSignalSent

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

Check if a signal has been sent (key stored with a value of 1).

Parameters

NameTypeDescription
appaddressThe address that sent this message.
signalbytes32The signal to check.

isSignalReceived

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

Check if signal has been received on the destination chain (current).

Parameters

NameTypeDescription
srcChainIduint256The source chain ID.
appaddressThe address that sent this message.
signalbytes32The signal to check.
proofbytesThe proof of the signal being sent on the source chain.

getSignalSlot

function getSignalSlot(address app, bytes32 signal) public pure returns (bytes32 signalSlot)

Parameters

NameTypeDescription
appaddressThe srcAddress of the app (eg. the Bridge).
signalbytes32The signal to store.

Return Values

NameTypeDescription
signalSlotbytes32The storage key for the signal on the signal service.