d
d
docs
Search…
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.
1
struct Instance {
2
address account;
3
uint256 lambda;
4
Ecosystem.Instance ecosystem;
5
Token.Instance token;
6
}
Copied!
    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

1
event Serialized(address indexed account, address indexed token);
Copied!

Functions

deserialize

Translates the data from the key-value pairs to a struct
1
function deserialize(address _account, Ecosystem.Instance memory _ecosystem, Token.Instance memory _token) external view returns (Instance memory record) {...}
Copied!

exists

Checks if the address already exists in the DAO (externally)
1
function exists(address _account, Token.Instance memory _token) external view returns (bool) {...}
Copied!

serialize

Translates the data from the concerned struct to key-value pairs
1
function serialize(Instance memory _record) external preventReentry {...}
Copied!

_exists

Checks if the address already exists in the DAO (internally)
1
function _exists(address _account, Token.Instance memory _token) internal view returns (bool) {...}
Copied!
Last modified 7mo ago