Contracts
Warning
Deployed on BNB Chain; trading opened on 30 November 2026. The addresses are on the Addresses page, and only there. NashHQ is an experiment: the contracts were reviewed in person by three independent auditors, who reported no findings; there is no written audit report yet (see Risks).
Network: BNB Smart Chain mainnet, chain ID 56. Solidity 0.8.28 (EVM cancun). DEX: PancakeSwap v3, fee tier
10000 (1%), tick spacing 200. Libraries: Solady and Vectorized DN404. The source is not verified
on BscScan yet; the Addresses page will say when it is.
| Contract | Token | name() on chain |
Standard |
|---|---|---|---|
NashToken |
$NASH | "Nash Flux" | ERC-404 in one contract (NashHQ's own) |
NashAIToken + DN404Mirror |
$NASHAI | "NashAI Core" | DN404 (ERC-7631): ERC-20 base + ERC-721 mirror |
NashIndexX |
$NASHX | "Nash Equilibrium" | ERC-20 (Solady) |
NashERC8004Controller |
— | — | Registers $NASHAI agents on ERC-8004, once each, and keeps their sealed memory roots |
NashLPLocker |
— | — | Holds the five pool positions forever; harvests fees |
NashSeeder |
— | — | Launch helper: seeds each pool at the planned start price in one transaction, then has no role. No owner, holds no BNB; only the deployer can call it |
NashSuperAgent + NashFusionVault |
Super Agent | "Nash Super Agent" | A later stage, not in the launch deploy. ERC-721 (Solady) with the BAP-578-style calls; the vault locks the fused agents |
LaunchGuard |
all three | — | Abstract 10-minute launch guard |
The symbols stay NASH, NASHAI and NASHX.
None of the tokens has a mint function after deploy, a transfer tax or a blocklist. None is upgradeable.
LaunchGuard#
Shared by the three tokens. Rules in Launch guard.
Trading opened on all three on 30 November 2026: launchTimestamp() is 06:49:10 UTC on $NASH, 06:49:34 UTC on
$NASHAI and 06:49:53 UTC on $NASHX, and guardActive() now returns false on each. The limits below applied only in
the 10 minutes after those times; they stay here as a record.
function setExempt(address account, bool status) external; // owner, only before trading opened: the locker, the seeder
function setMarket(address account, bool status) external; // owner, only before trading opened: the five pools
function enableTrading() external; // once: the owner; anyone after openDeadline. Starts the 10-minute guard
function guardActive() external view returns (bool);
function launchTimestamp() external view returns (uint256);
function openDeadline() external view returns (uint256); // first setMarket(…, true) + 30 days, at most deploy + 180 days
function maxTxLaunch() external view returns (uint256); // 1% of the token's supply
function maxWalletLaunch() external view returns (uint256); // 1.5%
function maxBlockLaunch() external view returns (uint256); // 1%: all markets together, per signer (tx.origin) and block
function isExempt(address) external view returns (bool);
function isMarket(address) external view returns (bool);
- Markets are the five pools only. A pool is not exempt: the wallet end of every swap is checked. Routers and
aggregators are ordinary wallets to the guard, so a buy delivered to a router counts against the router's 1.5%, and the
router cannot pass on tokens it received in the same block. An exact-input multi-hop swap through a NashHQ token
therefore fails during the 10 minutes (the router holds the middle token between the hops); an exact-output route
pays pool to pool and passes, within the signer's 1%. Single-hop swaps paid to the trader work.
Collecting liquidity to the position manager and sweeping it on in one transaction reverts
SameBlockSellin the 10 minutes: collect to the own wallet. - One cap per signer and block. The tokens that leave all markets for the transactions of one signer
(
tx.origin) in one block add up to at mostmaxBlockLaunch, whoever receives them. Without it, one transaction could split a large buy over many fresh addresses, each under the wallet limits. A buy that would pass the cap reverts withExceedsBlockLimit; the next block has a new cap. The cap is per signer, not shared: a first version with one cap per block for everyone let one actor fill it every block (recycling liquidity) so that no one else could buy.tx.originonly counts, it never grants anything. Many funded signers still get 1% each per block, and users behind one shared signer (an ERC-4337 bundler, a gas sponsor, a relayer) share that signer's 1%, so the dApp sends guard-window buys as the wallet's own transaction. - Same block. A wallet may not move on more than it held before this block's buys. Tokens it held earlier stay free.
0x…dEaDis exempt, so burns are never limited. The creator wallets and the deployer are not exempt once the seed has started. Both lists were frozen when trading opened.- Had the owner never opened trading, anyone could have called
enableTrading()30 days after the first pool was marked as a market, so the tokens could not stay frozen forever. The clock started with the pools, not at deploy, so a launch that slipped could not be opened before the pools existed. A backstop of 180 days after deploy covered an owner key lost before any market was marked.
NashToken ($NASH)#
// ERC-20
function name() external pure returns (string memory); // "Nash Flux"
function symbol() external pure returns (string memory); // "NASH"
function decimals() external view returns (uint8); // 18
function totalSupply() external pure returns (uint256); // 10,000e18
function balanceOf(address) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool); // always ERC-20
function transferFrom(address from, address to, uint256 valueOrId) external returns (bool);
function erc20TransferFrom(address from, address to, uint256 amount) external returns (bool);
// ERC-721
function approveAgent(address spender, uint256 id) external; // single-agent approval: owner or operator
function ownerOf(uint256 id) external view returns (address);
function tokenURI(uint256 id) external view returns (string memory); // baseURI + id + "?tier=flux"
function getApproved(uint256 id) external view returns (address);
function isApprovedForAll(address owner, address operator) external view returns (bool);
function setApprovalForAll(address operator, bool approved) external;
function safeTransferFrom(address from, address to, uint256 id) external;
function safeTransferFrom(address from, address to, uint256 id, bytes calldata data) external;
function supportsInterface(bytes4 id) external pure returns (bool); // ERC-165, ERC-721, ERC-721 metadata
// NashHQ additions
function nftBalanceOf(address) external view returns (uint256);
function tokensOfOwner(address) external view returns (uint256[] memory);
function getSkipNFT(address) external view returns (bool);
function setSkipNFT(bool skip) external; // for the caller only
function mintedCount() external view returns (uint256);
function mintTeamAgents() external; // once, right after deploy: #151 – #300 to creator wallet 2
function teamAgentsMinted() external view returns (bool);
function queuedCount() external view returns (uint256);
function setBaseURI(string calldata) external; // owner, until frozen
function freezeBaseURI() external; // owner, one way
function baseURIFrozen() external view returns (bool);
- Approvals.
approveis always an ERC-20 allowance, whatever the number, so an allowance can never pick an agent. Approve one agent withapproveAgent, all of them withsetApprovalForAll. - ID or amount. In
transferFroma value from 1 to 10,000 is always an agent ID; anything else is an amount. A wrong guess reverts. Dust amounts (10,000 wei or less) move withtransferanderc20TransferFrom. - Operators move agents with
safeTransferFromonly. On thetransferFromID path only the owner or the agent's own approval (approveAgent) is accepted, never asetApprovalForAlloperator. Otherwise a marketplace contract that settles both NFTs and ERC-20 payments withtransferFromwould read a $NASH payment of 1–10,000 wei as an agent ID and hand that agent over. Marketplaces that move NFTs with plaintransferFromtherefore cannot fill $NASH agent listings; $NASHAI agents trade there as normal. - Allowances and agents. Tokens moved with an allowance (
erc20TransferFrom, ortransferFromwith an amount) carry the sender's last agents, as they are, when the recipient takes agents. The spender cannot choose which numbers, but those numbers (and their pictures and memory) go with the tokens. Give allowances only to contracts you trust, as with any token. - Gas. Each agent minted costs about 48,000 gas and each one burned about 28,000. Moving many whole tokens to a wallet that takes agents mints one agent per token. BNB Chain refuses any transaction above 16,777,216 gas (BEP-652), so one transfer to such a wallet should stay at 263 $NASH or less; send a larger amount, or a larger buy, in parts. See Gas per transaction.
- Team agents in two steps. The constructor minted #1 – #150 to creator wallet 1. #151 – #300 were held back for
creator wallet 2 and minted by
mintTeamAgents(), once, after the deploy (anyone could call it; the recipient and the numbers are fixed at deploy). It is done:teamAgentsMinted()returns true. One constructor minting all 300 would have been above the gas cap. - Events. ERC-20
Transfer(from, to, amount)and ERC-721Transfer(from, to, id)share one signature; the ERC-721 one carries the ID as a third indexed topic. balanceOfis the ERC-20 balance even for ERC-721 tools; the number of agents isnftBalanceOf.- Contracts (pools, routers, the locker) hold no agents unless they turn them on with
setSkipNFT(false). A wallet with an EIP-7702 delegation (a wallet in smart-account mode: its code is0xef0100+ 20 bytes) counts as a wallet and takes agents. The same rule applies to $NASHAI. - Metadata location. The base URI is
https://api.nashai.tech/api/metadata/from the deploy. The owner can move it until it is frozen withfreezeBaseURI(), for good, so a leaked owner key cannot repoint every agent's name and picture later. For $NASH that happens at the Flux reveal, once the base points at the IPFS folder (see Agent metadata). - A wallet-to-wallet transfer of whole tokens moves the sender's agents as they are; only the rest is burned or minted. Burned numbers wait in a FIFO queue and are the next ones minted.
NashAIToken ($NASHAI) and its mirror#
Built on Vectorized DN404. The base holds all state; every NFT move on the mirror moves one whole token with it.
| Setting | Value | Effect |
|---|---|---|
_unit() |
1e18 |
one whole token = one NFT |
_useOneIndexed() |
true |
IDs start at #1 |
| skip NFT default for contracts | true |
pools and routers hold no NFTs (EIP-7702 wallets count as wallets) |
_useDirectTransfersIfPossible() |
true |
wallet-to-wallet transfers keep the sender's NFT IDs |
_addToBurnedPool() |
true |
burned IDs go to a FIFO queue and are reused |
| Permit2 default allowance | off | every spender needs a normal approve |
name() is "NashAI Core" and symbol() "NASHAI". The mirror's tokenURI(id) = baseURI + id + ?tier=core. The
base adds tokensOfOwner(address), nftBalanceOf(address), ownerAt(id), freezeBaseURI() / baseURIFrozen() (as
on $NASH) and lastAgentReceivedBlock(address), the last block in which an address received a Core agent (the
controller's one-block rule below); mirrorERC721() gives the mirror's address.
Never send BNB with a mirror call, or with any call to a NashHQ contract. The mirror's approve, transferFrom
and safeTransferFrom (from DN404) are payable. BNB sent with them is not used: the mirror passes it on to the
$NASHAI token, where it stays for good; no contract has a way to send BNB out. The same goes for the
ownership calls of the owned contracts (requestOwnershipHandover is open to anyone) and for any call that reaches the
$NASHAI token's fallback. One whole $NASHAI moves one agent, so the gas per transaction limit
applies to $NASHAI too: one transfer to a wallet that takes agents should stay at 1,112 $NASHAI or less. The NashHQ app never sets a BNB value on these calls. Integrators: always send them with value 0.
NashERC8004Controller#
function activateOfficialAgent(uint256 tokenId) external returns (uint256 officialAgentId);
// the agent's current holder only:
function updateAgentCardURI(uint256 tokenId, string calldata newURI) external;
function setAgentMetadata(uint256 tokenId, string calldata key, bytes calldata value) external;
function setAgentWallet(uint256 tokenId, address newWallet, uint256 deadline, bytes calldata signature) external;
function unsetAgentWallet(uint256 tokenId) external; // also right after buying; clears an old holder's settings too
// the holder of $NASHAI #tokenId (or of Super Agent #tokenId while it is fused) only, activated or not:
function sealMemoryRoot(uint256 tokenId, bytes32 root) external;
// the owner, once, before anyone can fuse: NashSuperAgent.vault() (WrongVault unless that Super Agent is built on
// this controller and on $NASHAI)
function setFusionVault(address vault) external;
// anyone, once the agent changed hands:
function clearStale(uint256 tokenId) external;
function tokenToOfficialAgentId(uint256 tokenId) external view returns (uint256);
function isRegistered(uint256 tokenId) external view returns (bool);
function activeControllerOf(uint256 tokenId) external view returns (address);
function activatedCount() external view returns (uint256);
function officialRegistry() external view returns (address);
function agentCardBaseURI() external view returns (string memory);
function memoryRoot(uint256 tokenId) external view returns (bytes32); // last sealed root; zero = never sealed
function getMemoryRoot(uint256 tokenId) external view returns (bytes32); // the same value
function sealedBy(uint256 tokenId) external view returns (address); // who sealed it; zero = never sealed
function configuredBy(uint256 tokenId) external view returns (address); // whose wallet/card/metadata are set; zero = defaults
function isStale(uint256 tokenId) external view returns (bool); // configuredBy is not the current holder
function metadataKeys(uint256 tokenId) external view returns (string[] memory);
function setAgentCardBaseURI(string calldata) external; // owner, until frozen
function freezeAgentCardBaseURI() external; // owner, one way
event AgentActivated(uint256 indexed tokenId, uint256 indexed officialAgentId, address indexed owner);
event MemorySealed(uint256 indexed tokenId, bytes32 indexed root, address indexed sealer, uint256 timestamp);
event SettingsCleared(uint256 indexed tokenId, address indexed previousHolder);
activateOfficialAgentrequires that the caller holds $NASHAI #tokenIdand that the number was never registered. It callsregister(agentCardBaseURI + id + ".json")on the ERC-8004 Identity Registry.- The controller owns the ERC-8004 identities, so control follows the $NASHAI agent: the card URI, metadata and agent wallet are open to its current holder only.
- One-block rule. Activation, sealing and every setting need the agent held since an earlier block: in the block a
wallet receives a Core agent, these calls revert with
HeldThisBlock. So a holder of one transaction (buy, act, sell) cannot set anything. A buyer simply waits for the next block (about a second).unsetAgentWalletandclearStalework at once, because they only clear.unsetAgentWalletis a single registry call, so a new holder can always take an old holder's wallet off. What it does not see: the rule reads only when a wallet last received a Core agent. An agent held inside a wrapper (an ERC-6551 token-bound account, a Safe, a fractionaliser) can change hands when the wrapper changes hands, with no agent transfer at all, so the rule does not apply to that change. Whoever controls the wrapper controls the agent's settings at once. Buying an agent through a wrapper means trusting the wrapper. - Agent wallet. The registry sets a new agent's payment wallet (
agentWallet) to the registrant, which would be the controller. Activation clears it at once. The holder sets their own withsetAgentWallet, signed by that wallet (EIP-712, checked by the registry). - Settings follow the holder. The controller remembers which holder set the wallet, card URI and metadata
(
configuredBy). Once the agent has changed hands (or sits burned in the queue), anyone may callclearStaleto put them back to the defaults: no wallet, the official cardagentCardBaseURI + id + ".json", empty metadata. The new holder's first change does the same first. So an old holder's wallet never keeps taking payments meant for the agent. Size caps keep clearing small enough for one transaction whatever an old holder stored: at most 8 metadata keys of at most 64 bytes, values of at most 512 bytes (ValueTooLong), card URIs of at most 512 bytes (URITooLong). Clearing the largest settings in a real transaction costs about 1,000,000 gas (cold storage), far below a BNB Chain block. Wallets should estimate gas for controller calls, never use a fixed limit. - Card location.
agentCardBaseURIishttps://api.nashai.tech/api/agent-card/from the deploy. The owner can move it (never to empty, at most 256 bytes) until it is frozen withfreezeAgentCardBaseURI(), for good. Freezing an empty location reverts, since it would block activation forever. A change of the base never reaches agents already activated: the registry keeps each agent's full card address from its activation, and only that agent's holder can move it (updateAgentCardURI). So the location is kept for good. - A number is registered once, ever, even if it is burned and minted again later.
Sealed memory root (the verifiable brain)#
sealMemoryRoot(tokenId, root)requires that the caller holds $NASHAI #tokenIdright now, since an earlier block. It needs no ERC-8004 activation. It storesrootasmemoryRoot(tokenId)and the caller assealedBy(tokenId), and emitsMemorySealed(tokenId, root, sealer, block.timestamp). A buyer can tell a seal made by the seller from one made by an earlier holder.rootis the root of the Core agent's memory as the NashHQ server publishes it atGET /api/agent/:tokenId/memory-hash?tier=core(rule on Server API). The contract does not check it: it records what the holder sends.- Opt-in, and the holder pays the gas: about 40,000–85,000 gas (a first seal costs the most), well under $0.01 at 0.05 gwei.
- The root belongs to the number, not the wallet. It stays when $NASHAI #
tokenIdchanges hands, until a later holder seals a new one. TheMemorySealedevents are the full history. - A buyer compares
memoryRoot(tokenId)with the server's current root. Equal roots mean the server's memory of the number is the one that was sealed. Nothing of the memory itself is on chain.
While the fusion vault holds $NASHAI #tokenId, every holder check reads the holder of Super Agent #tokenId
instead, and the one-block rule also counts a Super Agent received in this block.
NashSuperAgent and NashFusionVault#
// NashFusionVault (no owner, no BNB, no other asset)
function fuse(uint256 id) external; // caller holds $NASH #id and $NASHAI #id, approved the vault for each,
// and approved 1,000,000 $NASHX for the burn
function unfuse(uint256 id) external; // the holder of Super Agent #id only
function holderOf(uint256 id) external view returns (address); // zero when #id is not fused
function isSuperNumber(uint256 id) external view returns (bool); // true once #id was fused: it keeps its slot
function superNumbers() external view returns (uint256); // Super numbers so far, at most 333
function teamSuperNumbers() external view returns (uint256); // of them from #1 to #300, at most 10
function publicSuperNumbers() external view returns (uint256); // of them from #301 to #10,000, at most 323
function slotOpenFor(uint256 id) external view returns (bool); // could #id be fused now (slot only)
function nashx() external view returns (address); // the $NASHX burned on every fuse
// NashSuperAgent (ERC-721 "Nash Super Agent", NASHSA; tokenURI = baseURI + id + "?tier=super")
function getState(uint256 id) external view returns (State memory);
function getAgentMetadata(uint256 id) external view returns (AgentMetadata memory);
function updateAgentMetadata(uint256 id, AgentMetadata memory metadata) external; // holder only
function tokensOfOwner(address account) external view returns (uint256[] memory);
fusepulls the two agents by ID:approveAgent(vault, id)on $NASH andapprove(vault, id)on the $NASHAI mirror first. It never usessetApprovalForAllorsafeTransferFrom. The vault keeps NFTs off, so whole tokens sent to it mint nothing. It is not exempt from the launch guard.unfuseburns the Super Agent first, then sends both agents to its holder.NashSuperAgentdeploys its own vault, so both addresses are fixed. Only the vault mints and burns. The owner can set and freeze the metadata base URI, nothing else.- BAP-578:
vaultHashismemoryRoot(id)on the controller, never stored here; the holder's texts are at most 512 bytes each. They belong to one holding: every transfer and every burn starts a new one, so a buyer, a later fuser and a self-send start with empty texts.executeAction,setLogicAddress,fundAgent,pause,unpauseandterminatealways revert (NotEnabled), and it has noreceive. The ERC-721 callsapprove,transferFromandsafeTransferFromrevertNoBnbwhen BNB is sent with them. - A Super Agent can never be sent to the vault or to the Super Agent contract (
WouldLockForGood), so it can always be unfused.fuserevertsNotWireduntil the controller'sfusionVault()is this vault. - Cap and burn. At most 333 Super numbers: at most 10 from #1 to #300 and at most 323 from #301 to #10,000. The
10 are counted by number, not by wallet: whoever holds both halves of a number from #1 to #300 can fuse it. A
number is counted once, at its first fuse, and keeps its slot after an unfuse. Each
fuseburns 1,000,000 $NASHX from the caller's wallet straight to0x…dEaD(safeTransferFrom, so no approval or no balance reverts the whole fuse); the vault never holds $NASHX and an unfuse refunds nothing. - An agent sent to the vault by a plain transfer, not by
fuse, stays there for good, takes no slot and can never be fused. - Not deployed. These two contracts are a later stage and were not part of the launch deploy; the controller's
fusionVault()is still zero. The independent auditors reviewed them with the launch contracts. - Gas: about 500,000 for a first fuse (two agent moves, a mint, the slot count, the $NASHX burn and their bookkeeping); an unfuse costs much less. Always estimate gas for these calls, never hard-code it.
NashLPLocker#
Holds all five PancakeSwap v3 LP positions. It has no function that withdraws, decreases liquidity or moves a position, so the liquidity is locked for good.
function harvestTeam(uint256 positionId, uint128 max0, uint128 max1) external // anyone: $NASH/WBNB, $NASHAI/WBNB
returns (uint256 amount0, uint256 amount1); // fees -> team vault; type(uint128).max = all
function harvestAndBurn(uint256 positionId) external // keeper or owner; anyone once 7 days overdue: $NASHX pools
returns (uint256 burned, uint256 swappedIn);
function burnIsOverdue(uint256 positionId) external view returns (bool);
function lastBurnAt(uint256 positionId) external view returns (uint256);
function twapTick(address pool) external view returns (bool ok, int24 tick); // 10-minute average tick
function teamVault() external view returns (address); // fixed at deploy
function setKeeper(address) external; // owner
event TeamHarvest(uint256 indexed positionId, uint256 amount0, uint256 amount1);
event Burned(uint256 indexed positionId, uint256 nashxBurned, uint256 swappedIn, address tokenIn);
harvestAndBurn collects the fees, swaps the WBNB, $NASH or $NASHAI side into $NASHX in the same pool with $NASHX
going straight to 0x…dEaD, then sends the collected $NASHX there too. The swap stops at a price 300 ticks (about
3%) from the pool's 10-minute average (or from the spot price, whichever leaves less room); if the price is already
past that, or the pool has no 10-minute history yet, the swap waits for the next run. The collected $NASHX is burned
either way.
The team vault is fixed at deploy. The owner can change only the keeper, and the keeper can only trigger burns at the
on-chain price limit. harvestTeam takes caps so a large backlog can be collected in parts.
If a $NASHX position has not been burned for 7 days since its last burn by the keeper or owner, anyone may run
harvestAndBurn for it, under the same price limit. So a lost keeper key, a lost
owner key or a renounced owner cannot end the burn for good. At launch an owner burn ran on each of the three $NASHX
positions right after trading opened (lastBurnAt 06:50 UTC on 30 November 2026), which started the first 7 days. A
position that never had such a burn (for example a dust position
someone minted to the locker) never opens the public path, so a stranger cannot use it to time the swap of the
locker's leftovers. A public call restarts the 7 days only once nothing is left to swap.
The 10-minute average needs enough observation slots in each $NASHX pool: in the worst case one per block over 10
minutes, if every block has a trade. BNB Chain makes a block about every 0.45 seconds (measured on 2026-11-29: about
1,333 blocks in 10 minutes), so the deploy raised each of the three $NASHX pools to 3,000 slots with
increaseObservationCardinalityNext (observationCardinalityNext reads 3,000 on each, read on chain on 2026-11-30).
A pool fills the new slots as it records trades.