State¶
Description¶
An external state contract whose functions can only be called by an associated controller if modified with onlyAssociatedContract
.
This is designed to allow behaviour to be decoupled from storage so that upgrades can be made without losing data.
Source: contracts/State.sol
Variables¶
associatedContract
¶
The address (presumably a contract) which is permitted to use functions on this contract which have the onlyAssociatedContract
modifier.
Type: address
Constructor¶
constructor
¶
Initialises the associated contract and the owner, who has the exclusive right to switch the associated contract.
Details
Signature
constructor(address _associatedContract)
Visibility
internal
State Mutability
``
Requires
Emits
Restricted Functions¶
setAssociatedContract
¶
Allows the contract's owner to update the associated contract.
Details
Signature
setAssociatedContract(address _associatedContract)
Visibility
external
State Mutability
``
Modifiers
Emits
Modifiers¶
onlyAssociatedContract
¶
Reverts the transaction if the msg.sender
is not the associated contract. Provided for use by inheriting contracts.
Events¶
AssociatedContractUpdated
¶
The associated contract was updated by the owner. This event reports the new associated contract.
Signature: AssociatedContractUpdated(address associatedContract)