> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/network/building-on-nexus/deploying-on-nexusevm.md).

# Deploying on NexusEVM

NexusEVM is fully EVM-compatible.&#x20;

#### Deployment with Hardhat

```bash
npx hardhat run scripts/deploy.ts --network nexusMainnet
```

Verify deployment:

```bash
cast code 0xYOUR_CONTRACT_ADDRESS --rpc-url https://mainnet.rpc.nexus.xyz
```

#### Deployment with Foundry

See [Developer Environment Setup](https://docs.nexus.xyz/network/building-on-nexus/developer-environment-setup) for configuration.

```bash
forge create src/MyContract.sol:MyContract \
  --rpc-url nexus_mainnet \
  --chain-id 3946 \
  --private-key $PRIVATE_KEY
```

With constructor arguments:

```bash
forge create src/MyContract.sol:MyContract \
  --rpc-url nexus_mainnet \
  --chain-id 3946 \
  --private-key $PRIVATE_KEY \
  --constructor-args "arg1" 42
```

#### Gas

Gas metering follows Ethereum's model. All opcodes cost the same gas as on Ethereum. Gas limits are enforced — out-of-gas transactions revert normally. **Gas is paid in NEX.**

#### Differences from Ethereum

| Difference           | Detail                                                                                                                                      |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Block time           | 1 second (vs. Ethereum's 12s). `block.timestamp` increments faster — time-based logic works, but blocks-as-time proxies behave differently. |
| Finality             | Single-slot. No reorgs, no uncle blocks. One confirmation is sufficient. `block.number` is always authoritative.                            |
| Transaction ordering | CometBFT default mempool (FIFO). No gas auction, no MEV competition.                                                                        |
| Native currency      | NEX. `msg.value` transfers NEX.                                                                                                             |
| ENS                  | Not available on NexusEVM.                                                                                                                  |

#### Composability with the Exchange

When the Exchange launches, NexusEVM contracts will be able to call into NexusCore — placing orders, reading market data, and managing margin atomically within a single EVM transaction.&#x20;


---

# 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://docs.nexus.xyz/network/building-on-nexus/deploying-on-nexusevm.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.
