Skip to content

Solidity API

ISpanningDelegate

Interface of a Delegate in the Spanning Protocol.

getDomain

function getDomain() external view returns (bytes4)
NameTypeDescription
[0]bytes4bytes4 - Domain of the delegate.

makeDeployable

function makeDeployable() external override onlyOwner

Sets the deployable status to true.

revokeDeployable

function revokeDeployable() external override onlyOwner

Sets the deployable status to false.

isDeployable

function isDeployable() public view override returns (bool)
NameTypeDescription
[0]boolbool - Deployable status of the delegate.

isValidData

function isValidData() public view returns (bool)
NameTypeDescription
[0]boolbool - If the current stack has set Spanning Info correctly

currentSenderAddress

function currentSenderAddress() external view override returns (bytes32)
NameTypeDescription
[0]bytes32bytes32 - Address of the entity that contacted the delegate.

currentTxnSenderAddress

function currentTxnSenderAddress() external view override returns (bytes32)
NameTypeDescription
[0]bytes32bytes32 - Address of the originator of the transaction.

spanningCall

function spanningCall(bytes32 programAddress, bytes32 msgSenderAddress, bytes32 txnSenderAddress, bytes payload) external override onlyOwner nonReentrant

Used by authorized middleware to run a transaction on this domain. Note: We currently assume the contract owner == authorized address

NameTypeDescription
programAddressbytes32- Address to be called
msgSenderAddressbytes32- Address of the entity that contacted the delegate
txnSenderAddressbytes32- Address of the originator of the transaction
payloadbytes- ABI-encoding of the desired function call

makeRequest

function makeRequest(bytes32 programAddress, bytes payload) external

_Allows a user to request a call over authorized middleware nodes.

Note: This can result in either a local or cross-domain transaction. Note: Dispatch uses EVM Events as a signal to our middleware._

NameTypeDescription
programAddressbytes32- Address to be called
payloadbytes- ABI-encoding of the desired function call

Events

Received

event Received(address addr, uint256 value)

Emitted when payment is received in local gas coin.

NameTypeDescription
addraddress- Legacy (local) address that sent payment
valueuint256- Value (in wei) that was sent

LocalRequest

event LocalRequest(bytes32 programAddress, bytes32 msgSenderAddress, bytes32 txnSenderAddress, bytes payload, bytes returnData)

Emitted when a Spanning transaction stays on the current domain.

NameTypeDescription
programAddressbytes32- Address to be called
msgSenderAddressbytes32- Address of the entity that contacted the delegate
txnSenderAddressbytes32- Address of the originator of the transaction
payloadbytes- ABI-encoding of the desired function call
returnDatabytes- Information from the result of the function call

SpanningRequest

event SpanningRequest(bytes32 programAddress, bytes32 msgSenderAddress, bytes32 txnSenderAddress, bytes payload)

_Emitted when a Spanning transaction must leave the current domain.

Note: Spanning's middleware nodes are subscribed to this event._

NameTypeDescription
programAddressbytes32- Address to be called
msgSenderAddressbytes32- Address of the entity that contacted the delegate
txnSenderAddressbytes32- Address of the originator of the transaction
payloadbytes- ABI-encoding of the desired function call

Deployable

event Deployable(bool deployable)

Emitted when deployable status is set

NameTypeDescription
deployablebool- whether the delegate is deployable or not

SetSPAN

event SetSPAN(address spanAddr)

Emitted when SPAN contract is set

NameTypeDescription
spanAddraddress- the address of the set SPAN contract