Skip to content

TokenState

Description

An external state contract to hold ERC20 balances and allowances. This operates as an adjunct to ExternStateToken, so that important token information can persist while the token contract itself can be switched out to upgrade its functionality.

Source: contracts/TokenState.sol

Architecture

Inheritance Graph

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

Variables

allowance

Source

ERC20 allowances. Also generates an ERC20 accessor in the same way as the balanceOf member.

Type: mapping(address => mapping(address => uint256))

balanceOf

Source

ERC20 balances, note that as a public variable, this synthesises an accessor which is itself ERC20 compliant, so balances can be queried by dApps directly from the state contract.

Type: mapping(address => uint256)

Constructor

constructor

Source

Initialises the inherited State instance.

Details

Signature

(address _owner, address _associatedContract)

Visibility

public

State Mutability

nonpayable

Restricted Functions

setAllowance

Source

Sets the token allowance granted to the spender by the tokenOwner.

Details

Signature

setAllowance(address tokenOwner, address spender, uint256 value)

Visibility

external

State Mutability

nonpayable

Modifiers

setBalanceOf

Source

Sets the balance of the specified account.

Details

Signature

setBalanceOf(address account, uint256 value)

Visibility

external

State Mutability

nonpayable

Modifiers