TokenHolder.sol

A data storage for Token holders

The tokenHolder contract is used for storing an array of token holders in the DAO.

The tokenHolder contract inherits the EternalModel contract. The EternalModel contract is an implementation of the Eternal Storage pattern.

The tokenHolder contract consists of a struct of parameters that can be set while deploying the DAO.

struct Instance {
address account;
uint256 lambda;
Ecosystem.Instance ecosystem;
Token.Instance token;
}
  • account - an account of the token holder

  • lambda - the base value of the Governance token

  • ecosystem - the DAO ecosystem

  • token - token of the DAO

Functionality

List of events:

List of functions:

Events

Serialize

event Serialized(address indexed account, address indexed token);

Functions

deserialize

Translates the data from the key-value pairs to a struct

function deserialize(address _account, Ecosystem.Instance memory _ecosystem, Token.Instance memory _token) external view returns (Instance memory record) {...}

exists

Checks if the address already exists in the DAO (externally)

function exists(address _account, Token.Instance memory _token) external view returns (bool) {...}

serialize

Translates the data from the concerned struct to key-value pairs

function serialize(Instance memory _record) external preventReentry {...}

_exists

Checks if the address already exists in the DAO (internally)

function _exists(address _account, Token.Instance memory _token) internal view returns (bool) {...}