
Stargate
- 76 installs
- 9 repo stars
- Updated June 11, 2026
- vechain/vechain-ai-skills
Helps with ai & agent building tasks.
About
stargate is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- stargate
- AI & Agent Building
- AI-coding skill
Stargate by the numbers
- 76 all-time installs (skills.sh)
- Ranked #5,410 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/vechain/vechain-ai-skills --skill stargateAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 76 |
|---|---|
| repo stars | ★ 9 |
| Last updated | June 11, 2026 |
| Repository | vechain/vechain-ai-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
StarGate Skill
CRITICAL RULES
1. Read reference files FIRST. When the user's request involves any topic in the reference table below, read those files before doing anything else — before writing code, before making decisions. Briefly mention which files you are reading so the user can confirm the skill is active (e.g., "Reading StarGate staking reference..."). 2. Information priority for VeChain topics: (a) Reference files in this skill — always the primary source. (b) VeChain MCP tools — use @vechain/mcp-server for on-chain data, transaction building, and live network queries; use Kapa AI MCP for VeChain documentation lookups. (c) Web search — only as a last resort, and only for topics NOT covered in the reference files. 3. Prefer working directly in the main conversation for VeChain tasks. Plan mode and subagents do not inherit skill context and may fall back to web search instead of using reference files. 4. After compaction or context loss, re-read this SKILL.md to restore awareness of the reference table and operating procedure before continuing work.
Scope
Use this Skill for StarGate staking development:
- NFT-based staking platform integration
- Tiered staking and rewards
- Validator system and delegation
- Node Manager features
- Boosting mechanics
- Phase 2 breaking changes
Operating procedure
1. Clarify before implementing
When the user's request is ambiguous, ask before building. Key questions:
- Which staking tier or node level?
- Mainnet or testnet?
- Phase 1 or Phase 2 contract interfaces?
2. Implement with VeChain-specific correctness
- Network: always explicit (
mainnet/testnet/solo) - Tokens: VET for staking, VTHO for rewards
- Use correct contract addresses for the target network
3. Verify and deliver
A task is not complete until all applicable gates pass:
1. Code compiles — no build errors 2. Tests pass — existing tests still pass; new logic has test coverage 3. Risk notes documented — any staking or delegation implications are called out
Reference files
Read the matching files BEFORE doing anything else. See Critical Rules above.
| Topic | File | Read when user mentions... |
|---|---|---|
| StarGate staking | references/stargate-staking.md | staking, StarGate, validator, delegation, VTHO rewards, node tier, boosting, Node Manager |
| Smart contracts | references/contracts.md | Contract functions, roles, Stargate, StargateNFT, ProtocolStaker, delegation status, effective stake, maturity, boost, token manager, mint, burn, migrate |
StarGate Smart Contracts
When to use
Use when the user asks about:
- Stargate contract functions, roles, or architecture
- StargateNFT minting, burning, boosting, maturity, token managers
- ProtocolStaker delegation and validator interactions
- Delegation status, rewards claiming, effective stake
- Contract integration for staking flows
Contract Map
User
│
▼
Stargate (main entry point)
├──► StargateNFT (ERC721 — mint/burn NFTs, maturity, boost, managers)
└──► ProtocolStaker (protocol-level — validator/delegation VET deposits)- Stargate orchestrates all user actions: stake, unstake, delegate, claim rewards
- StargateNFT is the ERC721 contract representing staking positions; mint/burn only callable by Stargate
- ProtocolStaker is the on-chain protocol contract managing validator stakes and delegation deposits
Stargate
Main entry point for staking, delegation, and reward distribution. Upgradeable, pausable, access-controlled.
Key Types
enum DelegationStatus { NONE, PENDING, ACTIVE, EXITED }
struct Delegation {
uint256 delegationId;
address validator;
uint256 stake;
uint8 probabilityMultiplier;
uint32 startPeriod;
uint32 endPeriod;
bool isLocked;
DelegationStatus status;
}- NONE: no delegation exists
- PENDING: delegated but waiting for validator's next period to activate
- ACTIVE: earning rewards; stays ACTIVE even after requesting exit (until period ends)
- EXITED: delegation ended (user exited, validator exited, or pending delegation cancelled)
Key Functions
Staking
| Function | Description |
|---|---|
stake(uint8 levelId) payable → uint256 | Stake exact VET (msg.value) and mint NFT at given tier |
unstake(uint256 tokenId) | Burn NFT, return VET; delegation must not be ACTIVE; auto-claims rewards |
stakeAndDelegate(uint8 levelId, address validator) payable → uint256 | Stake + immediately delegate |
migrateAndDelegate(uint256 tokenId, address validator) payable | Migrate legacy node + delegate |
Delegation
| Function | Description |
|---|---|
delegate(uint256 tokenId, address validator) | Delegate to validator; active at next period; can re-delegate while PENDING |
requestDelegationExit(uint256 tokenId) | Signal exit; PENDING exits immediately, ACTIVE waits for period end; irreversible |
Rewards
| Function | Description |
|---|---|
claimRewards(uint256 tokenId) | Claim VTHO for all completed periods since last claim |
claimableRewards(uint256 tokenId) → uint256 | View claimable VTHO (first 832 periods / batch 0) |
claimableRewards(uint256 tokenId, uint32 batch) → uint256 | View claimable VTHO for specific batch (832 periods each) |
lockedRewards(uint256 tokenId) → uint256 | View rewards locked in current ongoing period |
claimableDelegationPeriods(uint256 tokenId) → (uint32 lastClaimed, uint32 endPeriod) | Period range for claimable rewards |
Rewards edge cases: claimRewards loops over periods and can run out of gas if >832 periods are unclaimed. Use maxClaimablePeriods (default 832) and call multiple times or use multi-clause transactions to claim before unstaking/re-delegating.
Query
| Function | Description |
|---|---|
getDelegationDetails(uint256 tokenId) → Delegation | Full delegation details |
getDelegationStatus(uint256 tokenId) → DelegationStatus | Current status |
getDelegationIdOfToken(uint256 tokenId) → uint256 | Latest delegation ID |
hasRequestedExit(uint256 tokenId) → bool | Whether exit was requested (true even if already EXITED) |
getEffectiveStake(uint256 tokenId) → uint256 | VET staked * reward multiplier for the tier |
getDelegatorsEffectiveStake(address validator, uint32 period) → uint256 | Total effective stake of all delegators for a validator in a period |
Admin
| Function | Description |
|---|---|
pause() / unpause() | Pause/unpause contract (DEFAULT_ADMIN_ROLE) |
setMaxClaimablePeriods(uint32) | Set max periods per claim call (DEFAULT_ADMIN_ROLE) |
Roles
| Role | Purpose |
|---|---|
| DEFAULT_ADMIN_ROLE | Pause/unpause, set max claimable periods |
| UPGRADER_ROLE | Authorize contract upgrades |
| PAUSER_ROLE | Pause/unpause |
Important Details
- Delegation activates at the next validator period, not immediately
- While PENDING, users can re-delegate to a different validator or cancel
- Once ACTIVE,
requestDelegationExitis the only way out (irreversible, waits for period end) unstakeanddelegateauto-claim pending rewards- VET flows: on delegate, VET moves from StargateNFT → ProtocolStaker; on exit, back through Stargate
- Probability multipliers:
PROB_MULTIPLIER_NODE(Eco tiers) andPROB_MULTIPLIER_X_NODE(X tiers) - Periods are validator-specific and numbered incrementally (not fixed duration)
Key Events
| Event | Emitted when |
|---|---|
DelegationInitiated(tokenId, validator, delegationId, amount, levelId, multiplier) | Delegation created |
DelegationExitRequested(tokenId, validator, delegationId, exitPeriod) | Exit requested |
DelegationWithdrawn(tokenId, validator, delegationId, amount, levelId) | VET withdrawn from delegation |
DelegationRewardsClaimed(receiver, tokenId, delegationId, amount, firstPeriod, lastPeriod) | Rewards claimed |
Key Errors
| Error | Cause |
|---|---|
TokenUnderMaturityPeriod(tokenId) | Trying to delegate before maturity ends |
InvalidDelegationStatus(tokenId, status) | Operation invalid for current delegation status |
DelegationExitAlreadyRequested | Exit already requested |
ValidatorNotActiveOrQueued(validator) | Validator not available for delegation |
VetAmountMismatch(levelId, required, provided) | Wrong VET amount for staking |
MaxClaimablePeriodsExceeded | Too many periods to claim in one call |
---
StargateNFT
ERC721 upgradeable contract representing staking positions. Mint/burn only callable by Stargate. Handles maturity periods, boosting, token managers, and level management.
Key Functions
Minting / Burning (Stargate-only)
| Function | Description |
|---|---|
mint(uint8 levelId, address to) → uint256 | Mint NFT at tier (Stargate only) |
burn(uint256 tokenId) | Burn NFT (Stargate only) |
migrate(uint256 tokenId) | Migrate legacy node to StargateNFT (Stargate only) |
Maturity & Boosting
| Function | Description |
|---|---|
boost(uint256 tokenId) | Skip maturity by paying VTHO (Stargate only) |
boostOnBehalfOf(address sender, uint256 tokenId) | Boost on behalf of user (Stargate only) |
boostAmount(uint256 tokenId) → uint256 | VTHO cost to boost a specific token |
boostAmountOfLevel(uint8 levelId) → uint256 | VTHO cost to boost any token of this level |
boostPricePerBlock(uint8 levelId) → uint256 | Per-block VTHO rate for boosting |
maturityPeriodEndBlock(uint256 tokenId) → uint64 | Block when maturity ends |
isUnderMaturityPeriod(uint256 tokenId) → bool | Whether token is still maturing |
Token Manager (Node Manager)
Managers can vote on VeVote and use the token in governance, but cannot claim rewards, transfer, delegate, or unstake. Manager is removed on transfer.
| Function | Description |
|---|---|
addTokenManager(address manager, uint256 tokenId) | Assign manager (owner only; replaces existing) |
removeTokenManager(uint256 tokenId) | Remove manager (owner only) |
getTokenManager(uint256 tokenId) → address | Get manager (returns owner if none) |
isTokenManager(address, uint256 tokenId) → bool | Check if address is manager |
isManagedByOwner(uint256 tokenId) → bool | Check if owner is also manager |
idsManagedBy(address) → uint256[] | Token IDs managed by address (owned + managed, excludes managed-by-others) |
tokensManagedBy(address) → Token[] | Same as above, returns full Token structs |
tokensOverview(address) → TokenOverview[] | All tokens related to user (owned, managed, or both) |
Token & Level Queries
| Function | Description |
|---|---|
getToken(uint256 tokenId) → Token | Full token data |
getTokenLevel(uint256 tokenId) → uint8 | Level ID of token |
tokensOwnedBy(address) → Token[] | All tokens owned by address (may OOG with many tokens) |
idsOwnedBy(address) → uint256[] | Token IDs owned by address |
ownerTotalVetStaked(address) → uint256 | Total VET staked by address |
tokenExists(uint256 tokenId) → bool | Whether token exists |
getCurrentTokenId() → uint256 | Latest minted token ID |
Level Management
| Function | Description |
|---|---|
addLevel(LevelAndSupply, uint256 boostPricePerBlock) | Add new tier (LEVEL_OPERATOR_ROLE) |
getLevelIds() → uint8[] | All level IDs |
getLevel(uint8 levelId) → Level | Level spec |
getLevels() → Level[] | All level specs |
getLevelSupply(uint8 levelId) → (uint208 circulating, uint32 cap) | Current supply and cap |
getLevelsCirculatingSupplies() → uint208[] | Circulating supply for all levels |
getCirculatingSupplyAtBlock(uint8 levelId, uint48 block) → uint208 | Historical supply |
X Token Queries
| Function | Description |
|---|---|
xTokensCount() → uint208 | Number of X tokens in circulation |
ownsXToken(address) → bool | Whether owner holds any X token |
isXToken(uint256 tokenId) → bool | Whether token is X category |
Roles
| Role | Purpose |
|---|---|
| DEFAULT_ADMIN_ROLE | Pause/unpause, transfer balance, admin functions |
| UPGRADER_ROLE | Authorize contract upgrades |
| PAUSER_ROLE | Pause/unpause |
| LEVEL_OPERATOR_ROLE | Add new staking levels/tiers |
| MANAGER_ROLE | Set base URI for NFT metadata |
| TOKEN_MANAGER_MIGRATOR_ROLE | Migrate token managers from legacy NodeManagementV3 |
Important Details
- NFTs are always transferable, even when delegated (changed in V3)
- Transfer removes the token manager automatically
- VET amount tracked in StargateNFT contract (legacy from pre-Hayabusa, kept to avoid migration complexity)
- Migrated legacy nodes have no maturity period
- No upgrade/downgrade: once minted at a level, it stays at that level
- Users must deposit exact VET amount for the tier (no more, no less)
- V3 removed all VTHO generation logic (Hayabusa changed VTHO to require active delegation)
REWARD_MULTIPLIER_SCALING_FACTOR: scaling factor for reward multiplier calculations
---
ProtocolStaker (IProtocolStaker)
Protocol-level interface for validator staking and delegation. The Stargate contract interacts with this to manage VET deposits.
Validator Functions
| Function | Description |
|---|---|
addValidation(address validator, uint32 period) payable | Create a new validator position |
increaseStake(address validator) payable | Add VET to queued/active validator |
decreaseStake(address validator, uint256 amount) | Remove VET from active validator |
signalExit(address validator) | Signal intent to exit at period end |
withdrawStake(address validator) | Withdraw VET after exit |
setBeneficiary(address validator, address beneficiary) | Set reward beneficiary address |
Delegation Functions
| Function | Description |
|---|---|
addDelegation(address validator, uint8 multiplier) payable → uint256 | Create delegation position, returns delegationID |
signalDelegationExit(uint256 delegationID) | Signal exit (funds available after period ends) |
withdrawDelegation(uint256 delegationID) | Withdraw delegation VET |
Query Functions
| Function | Description |
|---|---|
getDelegation(uint256 delegationID) → (validator, stake, multiplier, isLocked) | Delegation details |
getDelegationPeriodDetails(uint256 delegationID) → (startPeriod, endPeriod) | Delegation period range |
getValidation(address validator) → (endorser, stake, weight, queuedStake, status, offlineBlock) | Validator details |
getValidationPeriodDetails(address validator) → (period, startBlock, exitBlock, completedPeriods) | Validator period details |
getValidationTotals(address validator) → (lockedVET, lockedWeight, queuedVET, exitingVET, nextPeriodWeight) | Aggregate validator totals |
getDelegatorsRewards(address validator, uint32 period) → uint256 | Total delegator rewards for a validator period |
getWithdrawable(address validator) → uint256 | Withdrawable VET for an exited validator |
totalStake() → (totalStake, totalWeight) | All active validators combined |
queuedStake() → uint256 | All queued validators combined |
getValidationsNum() → (activeCount, queuedCount) | Number of active/queued validators |
issuance() → uint256 | Total VTHO generated in current block context |
firstActive() / firstQueued() / next(address) | Linked list traversal for validators |
StarGate (NFT-Based Staking & Delegation)
When to use
Use when the user asks about:
- Staking VET on VeChain
- StarGate NFTs and node tiers
- Validator delegation
- VTHO rewards from staking
- Boosting NFT maturity
- VeChain node management
- Legacy X Node or Economic Node migration
Important: VeChain StarGate is NOT a cross-chain bridge. It is VeChain's NFT-based staking platform launched as part of the Hayabusa phase (July 2025).
What is StarGate?
StarGate is VeChain's staking protocol that replaces the legacy node structure with an NFT-based staking and delegation framework. Staked VET positions are represented as tradable ERC721 NFTs, enabling secondary market liquidity while preserving staking rewards.
Key Features
- Minimum entry: 10,000 VET (Dawn tier)
- Liquid staking: NFTs are tradable on VeChain-based marketplaces
- Validator delegation: Delegate to validators and earn VTHO proportional to block production
- On-chain governance: NFTs serve as voting instruments for VeVote governance
- Fully on-chain: All staking logic is transparent and verifiable
VTHO Generation Change
Under StarGate, base VTHO rewards (generated passively by holding VET) no longer exist. VTHO can only be generated by actively delegating to a validator.
Staking Lifecycle
1. Stake: Select a node tier and lock the exact required VET. Protocol mints an NFT. 2. Maturity Period: Each NFT has a maturity countdown (2 to 90 days by tier). During maturity, the NFT cannot be delegated. Optionally boost (pay VTHO) to instantly mature. 3. Delegation: Once mature, delegate to a chosen validator. Delegation activates at the validator's next period. 4. Reward Accumulation: Delegated validator mines blocks; VTHO rewards are distributed to delegators weighted by tier multiplier. 5. Claiming: Rewards claimable at end of each validator period. 6. Unstaking: Burns NFT and returns staked VET. Only possible with no active delegation.
NFT Tiers
X Category (Limited Supply -- from legacy X Node migration)
| Tier | VET Required | Supply | Reward Multiplier |
|---|---|---|---|
| Mjolnir X | 15,600,000 | 158 | 5.0x |
| Thunder X | 5,600,000 | 180 | 4.0x |
| Strength X | 1,600,000 | 843 | 3.0x |
| VeThor X | 600,000 | 735 | 2.0x |
Eco Category (Open to all)
| Tier | VET Required | Supply | Reward Multiplier | Maturity |
|---|---|---|---|---|
| Mjolnir | 15,000,000 | 100 | 3.5x | 90 days |
| Thunder | 5,000,000 | 300 | 2.5x | - |
| Strength | large | Limited | 1.5x | - |
| Flash | 200,000 | - | 1.3x | 15 days |
| Lightning | 50,000 | - | 1.15x | 5 days |
| Dawn | 10,000 | - | 1.0x | 2 days |
Validator System
- Validators stake minimum 25 million VET
- Choose validation period of 7, 15, or 30 days
- Block selection probability proportional to own stake + delegated VET
- Validators receive block rewards + 100% of transaction priority fees
- Validators offline for 7+ consecutive days are forcibly removed
Smart Contract Architecture
Two primary contracts:
1. Stargate.sol -- Main entry point. Orchestrates staking, unstaking, delegation, and reward distribution. 2. StargateNFT.sol -- ERC721 upgradeable contract representing staking positions as NFTs.
Contract Addresses
Testnet
| Contract | Address |
|---|---|
| StarGate | 0x1E02B2953AdEfEC225cF0Ec49805b1146a4429C1 |
| StarGateNFT | 0x887d9102f0003f1724d8fd5d4fe95a11572fcd77 |
Mainnet addresses available at docs.stargate.vechain.org/for-developers/contracts.
Key API Functions
Staking
// Stake VET and mint an NFT
// _levelId specifies the tier (e.g., Dawn, Lightning, etc.)
// Requires exact VET amount as transaction value
await stargate.transact.stake(levelId, { value: requiredVET });
// Stake + immediately delegate (requires maturity or boost)
await stargate.transact.stakeAndDelegate(levelId, validatorId, { value: requiredVET });
// Combined: stake + boost (instant maturity, costs VTHO) + delegate
await stargate.transact.stakeAndBoostAndDelegate(levelId, validatorId, { value: requiredVET });Delegation
// Delegate an NFT to a validator (active at validator's next period)
await stargate.transact.delegate(tokenId, validatorId);
// Remove delegation
await stargate.transact.undelegate(tokenId);Rewards
// Claim accumulated VTHO rewards
await stargate.transact.claimRewards(tokenId);
// For multiple NFTs, use multi-clause transactions
const clauses = tokenIds.map(id => ({
to: stargateAddress,
value: '0x0',
data: ABIContract.encodeFunctionInput(stargateABI, 'claimRewards', [id]),
}));
// Check accrued rewards (current period, not yet claimable)
const accrued = await stargate.call.getAccruedRewards(tokenId);Unstaking
// Burns NFT, returns staked VET, auto-claims remaining rewards
// Only possible when no active delegation exists
await stargate.transact.unstake(tokenId);Boosting
// Instantly mature an NFT by paying VTHO fee
// IMPORTANT: Approve VTHO spending on StargateNFT contract first
await vthoContract.transact.approve(stargateNFTAddress, boostFee);
await stargate.transact.boost(tokenId);Critical: VTHO approval must be granted to the StargateNFT contract (not the Stargate contract) before boosting.
Phase 2 Breaking Changes
In Phase 2, delegation requires maturity to have elapsed first. The combined stakeAndBoostAndDelegate flow (paying VTHO for instant boost) is the only way to bypass the maturity waiting period.
Node Manager
NFT owners can assign a Node Manager (secondary wallet) with limited operational privileges (e.g., voting on VeVote) without transferring ownership of the NFT.
Developer Resources
- Documentation: docs.stargate.vechain.org
- GitHub: github.com/vechain/stargate-contracts
- StarGate dApp: app.stargate.vechain.org
- API Reference: docs.stargate.vechain.org/for-developers/api
Security
StarGate contracts have undergone:
- Hacken Audit (October 2025) -- strong code quality, role-based access control
- Trail of Bits Audit
- Immunefi Audit Competition (up to $40,000 in rewards)
- HackenProof DualDefense Contests ($36,000 and $50,000)