# Program Address

**EVM**

1. **Contract address is determined by the deployer's address and nonce (CREATE)**
2. **Contract address is determined by the contract's bytecode's hash, deployer's address and a random salt (CREATE2)**

```solidity
function determineAddress(bytes memory bytecode, uint256 salt)
    public
    view
    returns (address)
{
    bytes32 hash = keccak256(
        abi.encodePacked(
            bytes1(0xff), address(deployer), salt, keccak256(bytecode)
        )
    );

    return address(uint160(uint256(hash)));
}
```

Solana

Program address is determined by a generated private key. It has nothing to do with the deployer address nor the bytecode. The private key for the program is located at `target/deploy/$PROGRAM_NAME-keypair.json`.


---

# Agent Instructions: 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:

```
GET https://0xkowloon.gitbook.io/anchor-for-evm-developers/program-address.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
