Solidity API
SpanningUpgradeable_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
__Spanning_initfunction __Spanning_init(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
__Spanning_init_unchainedfunction __Spanning_init_unchained(address delegate) internal
Copy
isSpanningfunction isSpanning() external pure returns (bool)
Copy Name Type Description [0] bool bool - true if the contract is a Spanning contract
onlySpanningmodifier onlySpanning()
Copy Reverts if the function is executed by anyone but the Delegate.
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
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.
onlyOwnermodifier onlyOwner()
Copy Reverts if the function is executed by anyone but the owner.
ownerfunction owner() public view virtual returns (bytes32)
Copy Name Type Description [0] bytes32 bytes32 - Address of current owner
renounceOwnershipfunction renounceOwnership() public virtual
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
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
__gapThis empty reserved space is put in place to allow future versions to add new variables without shifting down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps We use a standard of 50 storage slots. The amount referenced below is based on: 50 - numberOfClassMemberVariables.