# Contracts

The Stargate staking system consists of two primary contracts that work together to manage VeChain protocol staking positions:

* `Stargate.sol:` The main entry point and business logic contract
* `StargateNFT.sol`: The ERC721 token contract representing staking positions

These contracts implement a separation of concerns where the NFT contract handles: token ownership and details, metadata, boosting and managers. While the Stargate contract manages the staking mechanics, validator delegation and rewards logic.

Contracts are public and can be found at the following repository: <https://github.com/vechain/stargate-contracts>

<table><thead><tr><th width="247.23828125">Contract</th><th>Address</th><th>Utilities</th></tr></thead><tbody><tr><td>StarGate</td><td>0x03c557be98123fdb6fad325328ac6eb77de7248c</td><td><a href="https://repo.sourcify.dev/100009/0x03c557be98123fdb6fad325328ac6eb77de7248c">Sourcify</a><br><a href="https://vechainstats.com/account/0x03c557be98123fdb6fad325328ac6eb77de7248c">VeChainStats</a></td></tr><tr><td>StarGateNFT</td><td>0x1856c533ac2d94340aaa8544d35a5c1d4a21dee7</td><td><a href="https://repo.sourcify.dev/100009/0x1856c533ac2d94340aaa8544d35a5c1d4a21dee7">Sourcify</a><br><a href="https://vechainstats.com/account/0x1856c533ac2d94340aaa8544d35a5c1d4a21dee7">VeChainStats</a></td></tr></tbody></table>

{% hint style="info" %}
Need testnet addresses? [Check out the Testnet section](/for-developers/testnet.md)!
{% endhint %}

## `Stargate.sol`

Entry point for all staking, delegation, and reward operations. Acts as the orchestrator between users, the `StargateNFT` contract, and the VeChain Protocol `Staker` contract.

* Orchestrates staking, delegation, exits, and reward accounting.
* Custodies VET during non-delegated phases; funds the on-chain validator delegation when active.
* Computes and pays out VTHO rewards.
* Coordinates state with the protocol (IProtocolStaker) and with the NFT contract.

Interactions with external protocol and tokens:

* → `StargateNFT`: Calls `mint()`, `burn()`, `migrate()`, `boostOnBehalfOf()`
* → Protocol `Staker` contract: Calls `addDelegation()`, `withdrawDelegation()`, `signalDelegationExit()`
* → `VTHO` Token: Transfers rewards using SafeERC20

## `StargateNFT.sol`

ERC721 NFT contract representing staking positions. Manages token metadata, levels, maturity periods, and acts as a continuation of the legacy VechainNodes (X-Node/Eco Node) collection.

* ERC721 that represents the staking position.
* Stores token metadata required for protocol math (level, vetAmountStaked, maturity, rewardsMultiplier, etc.).
* Manages levels, maturity periods, boosting, supply caps, and manager assignments.
* Can only be minted/burned by `Stargate` (not by users).

## Security audits

StarGate smart contracts have undergone two comprehensive security audits, respectively by [Hacken](https://hacken.io/) and [Trail of Bits](https://www.trailofbits.com/).

{% file src="/files/iVm52BFA6ZVq0sOAIt6f" %}

{% file src="/files/hoqGcbnzgF6ZJn8GbSNS" %}

## ABIs

{% file src="/files/aoHeZ7pOBWt913Ixp5Ae" %}

{% file src="/files/JxafsC9FFaI1QzwivtpB" %}

## Interfaces

{% file src="/files/nPJmIm0Fw5VcllrArQXx" %}

{% file src="/files/721EwKPBJodtEBughIW7" %}


---

# 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://docs.stargate.vechain.org/for-developers/contracts.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.
