Dao

Aside from the P2P relationship mentioned before, grouping relationships are also important in a social network. With this relationship, users with common interests can interact and communicate more effectively.

In the Relation Protocol, DAOs serve the follow purposes:

  • Provide a social platform

    With DAOs, people with common interests can build or join groups to create an interactive community.

  • DAO management

    The Relation Protocol provides certain management functions for DAOs. DAO creators can manage the DAO, add or remove members. These features are important for a DAO and its stability.

  • Increase user interaction and participation

    With DAOs, users can participate in social groupings more effectively to share their views and experience, thus increasing user interaction and participation.

Schema

DaoRegister

The schema corresponding to the DaoRegister contract is saved to Arweave in the form of a ttl file, with the transaction hash on Arweave as the schemaURI to be passed to the contract during its initialization stage. For example:

ar://7mRfawDArdDEcoHpiFkmrURYlMSkREwDnK3wYzZ7-x4

A complete rdf example to describe a DAO contract created by an address is as follows:

:Soul_0x0000000000000000000000000000000000000011 p:daoContract :Contract_0x1110000000000000000000000000000000000022 .

The schema consists of:

  • The list of prefixes.

PREFIX : <http://relationlabs.ai/entity/>
PREFIX p: <http://relationlabs.ai/property/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  • Class

:Soul represents the address binded with a domain name record resolved. Contract represents the address of the DAO contract.

:Soul a rdfs:Class ;
    rdfs:label "Soul" ;
    rdfs:comment "A soul." .

:Contract a rdfs:Class ;
    rdfs:label "Contract" ;
    rdfs:comment "A contract." .
  • Predicate

p:daoContract is used to describe the DAO contract address owned by an address

p:daoContract a rdf:Property ;
    rdfs:label "daoContract" ;
    rdfs:comment "The dao contract." ;
    rdfs:domain :Soul ;
    rdfs:range :Contract .

Dao

The schema corresponding to a DAO contract is stored on Arweave in the form of a ttl file, with the transaction hash as the schemaURI to be passed to the contract during its initialization stage. For example:

ar://UTbYdbPy5Ov2bZ1ikWm_4RhMT5GJPvasE57qtSfL1oQ

A complete rdf example to describe that a certain address has joined a certain DAO:

:Soul_0x0000000000000000000000000000000000000022 p:join :Dao_0x0000000000000000000000000000000000000011 .

The schema consists of:

  • schema's prefixes of namespaces

PREFIX : <http://relationlabs.ai/entity/>
PREFIX p: <http://relationlabs.ai/property/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  • Class

:Soul represents the addresses of the members who joined the group. :Dao represents the group

:Soul a rdfs:Class ;
    rdfs:label "soul" ;
    rdfs:comment "A soul" .

:Dao a rdfs:Class ;
    rdfs:label "dao" ;
    rdfs:comment "A dao" .
  • Predicate

p:join is used to describe the relationship between an address and a group.

p:join a rdf:Property ;
    rdfs:comment "Join a dao" ;
    rdfs:domain :Soul ;
    rdfs:range :Dao .

Contract

The DAO module consists of the DaoRegister contract and the DAO contract. We use the DaoRegister contract as the factory pattern and registration center to deploy and record the DAO contracts created by users.

DaoRegister

interface IDaoRegister is ISemanticSBT {
   /**
    * Deploy a DAO contract.
    * @param to 
    * @param name 
     * @return tokenId 
     */
    function deployDaoContract(address to,string memory name) external returns (uint256);

   /**
     * Lookup the information on a DAO.
     * @param tokenId 
     * @return owner  
     * @return contractAddress  
     */
    function daoOf(uint256 tokenId) external view returns (address owner, address contractAddress);
}

Dao

interface IDao is ISemanticSBT {

    //Contract initialization. The daoRegister initializes the contract:
    function initialize(
        address owner,
        address minter,
        string memory name_,
        string memory symbol_,
        string memory baseURI_,
        string memory schemaURI_,
        string[] memory classes_,
        Predicate[] memory predicates_
    ) external;

   /**
     * Set the information for a DAO. 
     * @param daoURI  This should be a hash on Arweave.
     */
    function setDaoURI(string memory daoURI) external;

    /**
     * Is this an open dao?
     * @param isFreeJoin true--free to join;false--closed to the public
     */
    function isFreeJoin() external view returns (bool);

    /**
     * Add the specified address to dao in batches.
     * @param addr The specified address.
     */
    function addMember(address[] memory addr) external;

    /**
     * Join a dao
     * @param tokenId  The tokenId for this member in the dao.
     */
    function join() external returns (uint256 tokenId);

    /**
     * Removed from a dao(calls the method "burn")
     * @param addr 
     */
    function remove(address addr) external;

    /**
     * The URI for a dao
     * @param daoURI  A resource address pointing to the data of a dao's information. It is a transaction hash on Arweave.
     */
    function daoURI() external view returns (string memory daoURI);

    /**
     * The owner of a dao
     * @param owner The owner of a dao
     */
    function ownerOfDao() external view returns (address owner);

    /**
      * Is a member of the dao?
      * @param addr 
      * @return isMember: true--is a member of the dao;false--not a member of the dao
     */
    function isMember(address addr) external view returns (bool isMember);

}

Full source code:

Last updated