Members

The module is mainly used internally for DAO members' management. It keeps track of basic information on members (see MemberInfo struct), and implements create, read, update, delete operations on them.

Stored Onchain

The DAO registers basic information on its members for its internal usage. A member's info are kept in the following structure:

MemberInfo (struct)

Structure containing basic information on a member

Members:

  • address (felt): Member's account address

  • delegatedKey (felt): Member's voting deleguate's address. The delegate is the one voting in the name of the member. It can be set to the member's address if delegation is unwanted. See Delegation.

  • shares (felt): Number of shares the member has. Shares give both voting weight and financial weight.

  • loot (felt): Number of loots the member has. Loot only give financial weight, but carries no voting rights.

  • jailed (felt): Whether the member has been jailed, which can happen if guildkicked. Jailed members cannot vote nor submit proposals.

  • lastProposalYesVote (felt): TODO (deprecated maybe...)

The DAO stores a list of its members' addresses along with a mapping between those addresses and the member's info. Internally, this is accomplished with the following 3 storage variables:

membersLength (storage_var)

Number of members in the DAO

Arguments: None

Returns: length (felt)

membersAddresses (storage_var)

List of the members' addresses

Arguments:

  • index (felt): the positional index of the member

Returns:

  • address (felt): the address of the member

membersInfo (storage_var)

Mapping of all members Info

Arguments:

  • address (felt): member's address

Returns:

  • member_ (MemberInfo): member's info

There are events triggered when there is a change to the stored members, that it be the addition of a new member, or any of the possible events modifying the info of an existing member (delegation, ragequit, guildkick, Yes vote, ...):

MemberAdded (event)

Triggered when a new member is added to the DAO.

Parameters:

  • memberAddress (felt): the new member's address

  • shares (felt): the new member's number of shares

  • loot (felt): the new member's number of loot

MemberUpdated (event)

Triggered when an existing member's info are modified.

Parameters:

  • memberInfo (MemberInfo): the member's new info.

Delegation

Each member also has the possibility to delegate his/her vote to another address through the delegatedKey mechanism. The delegateKey is fully managed by the owner, but the delegate has to be a member of the DAO. By default, the delegate and the member are the same, meaning in effect no delegation.

The following external functions are available for delegate management:

delegateVote (external func)

Allows a member to declare another member (possibly self) as a delegate

Arguments:

  • delegatedKey (felt): delegate's address

Returns:

  • success (felt): whether the delegation was successful.

Guards:

  • caller must be a member

  • delegate must be a member

revokeDelegate (external func)

The caller revokes his/her delegate. This is a convenience function for calling addDelegatdKey with his/her own address as a delegate.

Returns:

  • success (felt): whether the function succeeded.

Guards:

  • caller must be a member.

Last updated