Solidity API
Spanning_This module provides a number of utility functions and modifiers for interacting with the Spanning Network. It includes:
Functions abstracting delegate state and methods Functions for multi-domain ownership Note: This module is meant to be used through inheritance._
delegateLegacyAddressaddress delegateLegacyAddress
Copy
delegate_contract ISpanningDelegate delegate_
Copy
rootOwner
constructorconstructor(address delegate) internal
Copy Initializes a Spanning base module. Note: The initial rootOwner is set to whomever deployed the contract.
Name Type Description delegate address - Legacy (local) address of our Spanning Delegate
isSpanningfunction isSpanning() external pure returns (bool)
Copy Name Type Description [0] bool bool - true if the contract is a Spanning contract
isSpanningCallfunction isSpanningCall() public view returns (bool)
Copy Name Type Description [0] bool bool - true if a sender is a Spanning Delegate
getDomainfunction getDomain() internal view returns (bytes4)
Copy Name Type Description [0] bytes4 bytes4 - Domain identifier
delegateAddressfunction delegateAddress() internal view returns (address)
Copy Name Type Description [0] address address - Local (legacy) address of the Delegate
updateDelegatefunction updateDelegate(address newDelegateLegacyAddress) external override onlyOwner
Copy Updates Delegate's legacy (local) address.
Name Type Description newDelegateLegacyAddress address - Desired address for Spanning Delegate
makeRequestfunction makeRequest(bytes32 programAddress, bytes payload) internal virtual
Copy Creates a function request for a delegate to execute. Note: This can result in either a local or cross-domain transaction.
Name Type Description programAddress bytes32 - Address to be called payload bytes - ABI-encoding of the desired function call
getLegacyFromAddressfunction getLegacyFromAddress(bytes32 inputAddress) internal view returns (address)
Copy _Gets a Legacy Address from an Address, if in the same domain.
Note: This function can be used to create backwards-compatible events._
Name Type Description inputAddress bytes32 - Address to convert to a Legacy Address
Name Type Description [0] address address - Legacy Address if in the same domain, otherwise 0x0
getDomainFromAddressfunction getDomainFromAddress(bytes32 inputAddress) internal pure returns (bytes4)
Copy Gets a Domain from an Address
Name Type Description inputAddress bytes32 - Address to convert to a domain
Name Type Description [0] bytes4 domain - Domain ID
getAddressFromLegacyfunction getAddressFromLegacy(address legacyAddress) internal view returns (bytes32)
Copy Creates an Address from a Legacy Address, using the local domain.
Name Type Description legacyAddress address - Legacy (local) address to convert
Name Type Description [0] bytes32 bytes32 - Packed Address
spanningMsgSenderfunction spanningMsgSender() internal view returns (bytes32)
Copy Name Type Description [0] bytes32 bytes32 - Multi-domain msg.sender, defaulting to local sender.
spanningTxnSenderfunction spanningTxnSender() internal view returns (bytes32)
Copy Name Type Description [0] bytes32 bytes32 - Multi-domain tx.origin, defaulting to local origin.
isValidSpanningInfofunction isValidSpanningInfo() internal view returns (bool)
Copy Name Type Description [0] bool bool - True if the current call stack has valid Spanning Info
spanningMsgSenderUncheckedfunction spanningMsgSenderUnchecked() internal view returns (bytes32)
Copy Name Type Description [0] bytes32 bytes32 - Multi-domain msg.sender, defaulting to local sender.
spanningTxnSenderUncheckedfunction spanningTxnSenderUnchecked() internal view returns (bytes32)
Copy Name Type Description [0] bytes32 bytes32 - Multi-domain tx.origin.
ownerfunction owner() public view virtual returns (bytes32)
Copy Name Type Description [0] bytes32 bytes32 - Address of current owner
renounceOwnershipfunction renounceOwnership() public virtual override onlyOwner
Copy Sets the owner to null, effectively removing contract ownership. Note: It will not be possible to call onlyOwner
functions anymore Note: Can only be called by the current owner
transferOwnershipfunction transferOwnership(bytes32 newOwnerAddress) public virtual override onlyOwner
Copy Assigns new owner for the contract. Note: Can only be called by the current owner
Name Type Description newOwnerAddress bytes32 - Address for desired owner
_transferOwnershipfunction _transferOwnership(bytes32 newOwnerAddress) internal virtual
Copy Transfers ownership of the contract to a new Address.
Name Type Description newOwnerAddress bytes32 - Address for desired owner
Modifiers
onlySpanningmodifier onlySpanning()
Copy Reverts if the function is executed by anyone but the Delegate.
onlyOwnermodifier onlyOwner()
Copy Reverts if the function is executed by anyone but the owner.