Skip to content

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: State.sol

Architecture


Inheritance Graph

State inheritance graph


Variables


associatedContract

The address (presumably a contract) which is permitted to use functions on this contract which have the onlyAssociatedContract modifier.

Type: address public


Functions


constructor

Initialises the associated contract and the owner, who has the exclusive right to switch the associated contract.

Details

Signature

constructor(address _owner, address _associatedContract)

Superconstructors

Emits


setAssociatedContract

Allows the contract's owner to update the associated contract.

Details

Signature

setAssociatedContract(address _associatedContract) external

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)