> For the complete documentation index, see [llms.txt](https://relationlabs.gitbook.io/protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://relationlabs.gitbook.io/protocol/protocol-zh/open-standard-api/overview/relationship.md).

# Relationship

## Follow

### FollowRegister

1. 部署follow合约

```solidity
  function deployFollowContract(address owner) external returns (uint256);
```

部署用户的follow合约，并记录至FollowRegister合约上

参数：

* owner: 接受Follow合约的地址

返回：

* tokenId: follow合约在当前FollowRegister合约里的tokenId

2. 查询地址的Follow合约地址

```solidity
  function ownedFollowContract(address owner) external view returns (address);
```

查询地址所持有的Follow合约

参数：

* owner: 接受Follow合约的地址

返回：

* contractAddress： Follow合约地址

### Follow

1. 关注

```solidity
function follow() external returns (uint256);
```

follow当前合约的owner

返回：

* tokenId: 本次follow在合约里的tokenId

2. 取消关注

```solidity
  function unfollow() external;
```

取消对当前合约的owner的关注

## Dao

### DaoRegister

1. 部署follow合约

```solidity
  function deployDaoContract(address owner,string memory name) external returns (uint256);
```

部署Dao合约，并记录至DaoRegister合约上，创建者即为合约的owner

参数：

* owner: 接受dao合约的地址
* name: dao合约的名称

返回：

* tokenId: dao合约在当前DaoRegister合约里的tokenId

2. 查询Dao信息

```solidity
  function daoOf(uint256 tokenId) external view returns(address owner,address contractAddress);
```

根据tokenId查询其关联的Dao合约的owner以及地址信息

参数：

* tokenId

返回：

* owner: Dao合约的创建者
* contractAddress: Dao合约地址

### Dao

1. 设置daoURI

```solidity
function setDaoURI(string memory daoURI) external;
```

设置当前群组信息，传入群组信息数据在Arweave上的交易哈希

入参：

* daoURI: 一个资源地址，是Arweave上的交易哈希,指向内容为dao的信息描述

上传至Arweave的内容格式如下：

```json
{
  "avatar": "${The avatar of DAO}",
  "description": "${The description of DAO}"
}
```

2. 查询daoURI

```solidity
function daoURI() external view returns (string memory _daoURI);
```

查询当前群组信息，返回的Arweave交易哈希可访问到群组的详细信息

入参：

* \_daoURI: 一个资源地址，是Arweave上的交易哈希,指向内容为dao的信息描述

3. 是否开放加入

```solidity
function isFreeJoin() external view returns (bool);
```

查看当前群是否开放加入，即无需管理员邀请即可加入

返回：

* isFreeJoin: true--允许开放加入；false--不允许开放加入

4. 将指定地址加入dao

```solidity
function addMember(address[] memory addr) external;
```

将指定的地址批量加入dao，仅由dao的创建者执行。

入参：

* addr: 待加入的地址

5. 加入群组

```solidity
  function join() external returns (uint256 tokenId);
```

用户主动加入dao，当前方法的调用者作为dao的成员

返回：

* tokenId: 当前成员在群组中的tokenId

6. 移出群组

```solidity
  function remove(address addr) external;
```

将指定成员从群组内移出

入参：

* addr: 被移出的成员地址

7. 是否为dao的成员

```solidity
  function isMember(address addr) external view returns(bool);
```

查询某个地址是否为dao的成员

入参：

* addr: 待查询的地址

返回：

* isMember: true-dao的成员；false-不属于dao的成员

8. 查询dao的owner

```solidity
  function ownerOfDao() external view returns(address owner);
```

查询dao的owner

返回：

* owner: dao的owner


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://relationlabs.gitbook.io/protocol/protocol-zh/open-standard-api/overview/relationship.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
