nuvex-services README

The project's README from github.com/NuvexNetwork/nuvex-services. As one markdown file: README.md.

Gild contracts

Foundry project for Gild on BNB Smart Chain: DammHook, GildRouter, fee collector, and banded buyback. The Next.js app lives in the sibling folder gild-app.

This code is unaudited. Do not route production size until the Four.meme selectors are checked against the verified BscScan ABI and an independent review is done. Infinity Bin is not shipped.

Layout

Install

curl -L https://foundry.paradigm.xyz | bash
foundryup
forge install

forge install pulls forge-std and OpenZeppelin into lib. Those directories are gitignored. The Infinity types under lib/infinity-core are a layout-compatible excerpt so the hook matches ICLHooks without compiling Pancake's AMM. See lib/infinity-core/NOTICE.md.

Test

forge test

Hook permissions

Pancake Infinity does not mine permission bits into the hook address. getHooksRegistrationBitmap() is copied into PoolKey.parameters (low 16 bits). Tick spacing occupies bits 16–39. script/SeedPool.s.sol sets tick spacing 10 that way.

A CREATE2 vanity salt is optional and does not change permissions. Do not port Uniswap v4 address flags onto this hook.

Deploy

Fill .env from .env.example. Never commit PRIVATE_KEY.

forge script script/Deploy.s.sol --rpc-url "$BSC_TESTNET_RPC" --broadcast

Set GILD_TOKEN to the Flap launch address before running the script. The script does not deploy a token and does not mint. Buyback is constructed with that address. On chain id 56 the token must already be a Flap curve token (status 1) or a graduated Flap token (status 4); the script then calls syncFlap so the registry follows the portal. Chain id 97 uses the Infinity testnet manager and vault from config/addresses.json. Chain id 56 uses mainnet. The script deploys config, fee collector, buyback, hook, registry, adapter, router, and quoter, then proposes a 2-day TimelockController as the next config owner. The timelock must call acceptOwnership. Seed liquidity before that acceptance:

forge script script/SeedPool.s.sol --rpc-url "$BSC_RPC" --broadcast

The Pancake V2 router in config is 0x10ED43C718714eb63d5aA57B78B54704E256024E. That is the deployed router.

Four.meme and Flap

IFourMeme follows Four.meme's published TokenManager2 and Helper3 notes dated 2025-10-30:

Replace those interfaces if BscScan verification disagrees. Tests use MockFourMeme.

Flap uses the portal at 0xe2cE6ab80874Fa9Fa2aAE65D277Dd6B8e65C9De0. IFlap matches the swapExactInput and getTokenV8Safe fragments already used by the app. Deploy.s.sol calls setPortal on mainnet. FeeCollector.forwardToBuyback sends swept WBNB to the buyback contract.

nuvex-services (NuvexNetwork/nuvex-services)

router
Searching Database…

What is this?A Foundry project of Solidity smart contracts for Gild on BNB Smart Chain: a DammHook, GildRouter, a fee collector and a banded buyback, plus deploy and liquidity-seeding scripts.
Is it just the contracts, or is there a frontend too?Just the contracts side: Solidity sources in src, Foundry tests and deploy scripts. The Next.js app lives in a separate sibling folder called gild-app, not in this repo.
How do I get it set up locally?Clone the repo and run 'forge install': it pulls forge-std and OpenZeppelin into the gitignored lib folder. Canonical Pancake and WBNB addresses live in config/addresses.json.
What do I need before I can run the deploy script?A Foundry toolchain and a .env copied from .env.example with your private key (never commit it) and GILDTOKEN set to the Flap launch address; the script deploys no token and mints nothing.
Is it safe to route real volume through it today?No. The code is unaudited, and the README says not to route production size until the Four.meme selectors are checked against the verified BscScan ABI and an independent review is done.
What does the deploy script actually put on chain?Config, fee collector, buyback, hook, registry, adapter, router and quoter. It then proposes a 2-day TimelockController as the next config owner; the timelock must call acceptOwnership, and liquidity should be seeded before that acceptance.
Which chains does it target?BNB Smart Chain mainnet (chain id 56) and testnet (chain id 97). On mainnet the GILD token must already be a Flap curve token (status 1) or a graduated Flap token (status 4); the script then calls syncFlap.
How do hook permissions work on Pancake Infinity?Permission bits are not mined into the hook address: getHooksRegistrationBitmap() is copied into PoolKey.parameters (low 16 bits) and tick spacing occupies bits 16-39. Uniswap v4 address flags must not be ported onto this hook.
Where do the collected fees go?FeeCollector.forwardToBuyback sends swept WBNB to the buyback contract, which does banded buybacks; TOKENOMICS.md documents the Flap-launched GILD supply and the fee burn path.
Size
0.1 MB
Stars
201
Updated
CommitOct 03
Age
18d
Commits · 90 Days