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

Architecture

Inheritance Graph

graph TD State[State] --> Owned[Owned]

Variables

associatedContract

Source

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

Type: address

Constructor

constructor

Source

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

Details

Signature

(address _associatedContract)

Visibility

internal

State Mutability

nonpayable

Requires

Emits

Restricted Functions

setAssociatedContract

Source

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

Details

Signature

setAssociatedContract(address _associatedContract)

Visibility

external

State Mutability

nonpayable

Modifiers

Emits

Modifiers

onlyAssociatedContract

Source

Reverts the transaction if the msg.sender is not the associated contract. Provided for use by inheriting contracts.

Events

AssociatedContractUpdated

Source

The associated contract was updated by the owner. This event reports the new associated contract.

Signature: AssociatedContractUpdated(address associatedContract)