Docs
Reference
Contract documentation
signal
SignalService

SignalService

See the documentation in {ISignalService} for more details.

SignalProof

struct SignalProof {
  uint64 height;
  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()

validApp

modifier validApp(address app)

validSignal

modifier validSignal(bytes32 signal)

validChainId

modifier validChainId(uint256 srcChainId)

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 (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) public 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) public 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.

getSignalSlot

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

Get the storage slot of the signal.

Parameters

NameTypeDescription
appaddressThe address that initiated the signal.
signalbytes32The signal to get the storage slot of.

Return Values

NameTypeDescription
signalSlotbytes32The unique storage slot of the signal which is created by encoding the sender address with the signal (message).

title: ProxiedSignalService

ProxiedSignalService

Proxied version of the parent contract.