d
d
docs
Search…
DAO.sol
The DAO contract is used to store the core data of the ElasticDAO. it inherits the EternalModel contract. The EternalModel contract is an implementation of the Eternal Storage pattern.
1
struct Instance {
2
address uuid;
3
address[] summoners;
4
bool summoned;
5
string name;
6
uint256 maxVotingLambda;
7
uint256 numberOfSummoners;
8
Ecosystem.Instance ecosystem;
9
}
Copied!
    uuid - is an address of the unique user ID
    summoners - stores an array of addresses of the summoners
    summoned - checks if summoned or not
    name - is a name of the unique user ID
    maxVotingLambda - is the maximum amount of lambda that can be used to vote in the DAO
    numberOfSummoners - is the number of summoners
    ecosystem - is the DAO ecosystem

Functionality

List of events:

List of functions:

Events

Serialized

1
event Serialized(address indexed uuid);
Copied!

Functions

deserialize

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

parameters

1
@param _uuid - address of the unique user ID
Copied!

exists

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

parameters

1
@param _uuid - address of the unique user ID
Copied!

getSummoner

Checks the index number of the summoner
1
function getSummoner(Instance memory _dao, uint256 _index) external view returns (address) {...}
Copied!

parameters

1
@param _dao - DAO.Instance
2
@param _index - index of the summoner
Copied!

isSummoner

Checks if the msg.sender is a summoner
1
function isSummoner(Instance memory _dao, address _summonerAddress) external view returns (bool) {...}
Copied!

parameters

1
@param _dao DAO.Instance
2
@param _summonerAddress address
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 _uuid) internal view returns (bool) {...}
Copied!
Last modified 7mo ago