> 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/getting-started.md).

# Getting Started

#### Prerequisites

* **Wallet** — MetaMask or any EVM-compatible wallet, configured for Nexus (See [Developer Environment Setup](https://docs.nexus.xyz/network/building-on-nexus/developer-environment-setup))
* **Testnet tokens** — NEX on testnet for gas ([faucet](https://faucet.nexus.xyz))
* **Toolchain** — Hardhat or Foundry

#### Quickstart: Deploy a contract on NexusEVM

**Step 1 — Create a Foundry project**

```bash
mkdir nexus-token && cd nexus-token
forge init
```

**Step 2 — Write the contract**

Replace `src/Counter.sol` with `src/NexusToken.sol`:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "lib/openzeppelin-contracts/src/token/ERC20/ERC20.sol";

contract NexusToken is ERC20 {
    constructor(uint256 initialSupply) ERC20("NexusToken", "NTK") {
        _mint(msg.sender, initialSupply);
    }
}
```

Install OpenZeppelin:

```bash
forge install OpenZeppelin/openzeppelin-contracts --no-commit
```

**Step 3 — Deploy to Nexus Testnet**

```bash
forge create src/NexusToken.sol:NexusToken \
  --rpc-url https://testnet.rpc.nexus.xyz \
  --chain-id 3945 \
  --private-key $PRIVATE_KEY \
  --constructor-args 1000000000000000000000000
```

This deploys 1,000,000 NTK to your address.

**Step 4 — Read on-chain state**

Check your balance:

```bash
cast call <CONTRACT_ADDRESS> "balanceOf(address)" $YOUR_ADDRESS \
  --rpc-url https://testnet.rpc.nexus.xyz
```

Transfer tokens:

```bash
cast send <CONTRACT_ADDRESS> "transfer(address,uint256)" \
  <RECIPIENT_ADDRESS> 1000000000000000000 \
  --rpc-url https://testnet.rpc.nexus.xyz \
  --private-key $PRIVATE_KEY
```

**Step 5 — Deploy to mainnet**

When ready, switch to mainnet:

```bash
forge create src/NexusToken.sol:NexusToken \
  --rpc-url https://mainnet.rpc.nexus.xyz \
  --chain-id 3946 \
  --private-key $PRIVATE_KEY \
  --constructor-args 1000000000000000000000000
```

Finality is single-slot — the deployment is confirmed as soon as the block is committed.

#### Quickstart: Interact with the chain using cast

No project setup needed. These commands work immediately with Foundry installed.

Get the latest block number:

```bash
cast block-number --rpc-url https://mainnet.rpc.nexus.xyz
```

Read any contract's state:

```bash
cast call <CONTRACT_ADDRESS> "symbol()" --rpc-url https://mainnet.rpc.nexus.xyz
```

Check an address balance:

```bash
cast balance <ADDRESS> --rpc-url https://mainnet.rpc.nexus.xyz
```

Send a transaction:

```bash
cast send <TO_ADDRESS> --value 0.1ether \
  --rpc-url https://mainnet.rpc.nexus.xyz \
  --private-key $PRIVATE_KEY
```

All transactions confirm with single-slot finality. No need to wait for additional block confirmations.


---

# 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/getting-started.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.
