> For the complete documentation index, see [llms.txt](https://poseidon.seaeye.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://poseidon.seaeye.cn/evm/utils/calculate_create2_case_contract_address.md).

# calculate\_create2\_case\_contract\_address

计算某合约账户以 CREATE2 方式部署的另一个合约的地址。

## 方法定义

```python
@staticmethod
def calculate_create2_case_contract_address(deployer: ChecksumAddress, salt: HexStr, creation_code: HexStr) -> Optional[ChecksumAddress]
```

## 参数说明

| 参数             | 类型              | 说明                   |
| -------------- | --------------- | -------------------- |
| deployer       | ChecksumAddress | 部署者地址(此处应该为合约地址)     |
| salt           | HexStr          | 盐值                   |
| creation\_code | HexStr          | 合约的创建时字节码(与运行时字节码不同) |

## 返回值

| 类型                         | 说明       |
| -------------------------- | -------- |
| Optional\[ChecksumAddress] | 计算出的合约地址 |

## 示例代码

```python
# 计算 CREATE2 部署的合约地址
contract_address = Utils.calculate_create2_case_contract_address(
    deployer="0x...",      # 工厂合约地址
    salt="0x123...",       # 盐值
    creation_code="0x..."  # 创建时字节码
)
if contract_address:
    print(f"Contract will be deployed at: {contract_address}")
```


---

# 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://poseidon.seaeye.cn/evm/utils/calculate_create2_case_contract_address.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.
