Solidity API
ISpanningDelegate
Interface of a Delegate in the Spanning Protocol.
getDomain
function getDomain() external view returns (bytes4)
Name | Type | Description |
---|---|---|
[0] | bytes4 | bytes4 - 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)
Name | Type | Description |
---|---|---|
[0] | bool | bool - Deployable status of the delegate. |
isValidData
function isValidData() public view returns (bool)
Name | Type | Description |
---|---|---|
[0] | bool | bool - If the current stack has set Spanning Info correctly |
currentSenderAddress
function currentSenderAddress() external view override returns (bytes32)
Name | Type | Description |
---|---|---|
[0] | bytes32 | bytes32 - Address of the entity that contacted the delegate. |
currentTxnSenderAddress
function currentTxnSenderAddress() external view override returns (bytes32)
Name | Type | Description |
---|---|---|
[0] | bytes32 | bytes32 - 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
Name | Type | Description |
---|---|---|
programAddress | bytes32 | - Address to be called |
msgSenderAddress | bytes32 | - Address of the entity that contacted the delegate |
txnSenderAddress | bytes32 | - Address of the originator of the transaction |
payload | bytes | - 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._
Name | Type | Description |
---|---|---|
programAddress | bytes32 | - Address to be called |
payload | bytes | - ABI-encoding of the desired function call |
Events
Received
event Received(address addr, uint256 value)
Emitted when payment is received in local gas coin.
Name | Type | Description |
---|---|---|
addr | address | - Legacy (local) address that sent payment |
value | uint256 | - 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.
Name | Type | Description |
---|---|---|
programAddress | bytes32 | - Address to be called |
msgSenderAddress | bytes32 | - Address of the entity that contacted the delegate |
txnSenderAddress | bytes32 | - Address of the originator of the transaction |
payload | bytes | - ABI-encoding of the desired function call |
returnData | bytes | - 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._
Name | Type | Description |
---|---|---|
programAddress | bytes32 | - Address to be called |
msgSenderAddress | bytes32 | - Address of the entity that contacted the delegate |
txnSenderAddress | bytes32 | - Address of the originator of the transaction |
payload | bytes | - ABI-encoding of the desired function call |
Deployable
event Deployable(bool deployable)
Emitted when deployable status is set
Name | Type | Description |
---|---|---|
deployable | bool | - whether the delegate is deployable or not |
SetSPAN
event SetSPAN(address spanAddr)
Emitted when SPAN contract is set
Name | Type | Description |
---|---|---|
spanAddr | address | - the address of the set SPAN contract |