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)

Searching Database…

这是干什么的?一个面向 BNB Smart Chain 上 Gild 的 Solidity 智能合约 Foundry 项目:包含一个 DammHook、GildRouter、一个手续费收集合约和一个区间回购合约,外加部署脚本和流动性种子脚本。
只有合约,还是也带前端?只有合约部分:src 里是 Solidity 源码,还有 Foundry 测试和部署脚本。Next.js 应用放在旁边一个叫 gild-app 的独立文件夹里,不在这个仓库中。
我在本地怎么把它跑起来?克隆仓库并运行 'forge install':它会把 forge-std 和 OpenZeppelin 拉取到被 gitignore 的 lib 文件夹里。Pancake 和 WBNB 的标准地址在 config/addresses.json 里。
运行部署脚本之前我需要准备什么?需要装好 Foundry 工具链,并从 .env.example 复制一份 .env,填入你的私钥(千万别提交到仓库)并把 GILDTOKEN 设置为 Flap 启动地址;这个脚本本身不部署代币,也不铸造任何东西。
现在就把真实交易量跑在上面安全吗?不安全。代码未经审计,README 明确说,在把 Four.meme 的选择器与 BscScan 上已验证的 ABI 核对过、并完成独立审查之前,不要接入生产规模的交易量。
部署脚本实际上链部署了哪些东西?Config、手续费收集合约、回购合约、hook、registry、adapter、router 和 quoter。随后它会把一个为期 2 天的 TimelockController 提名为下一个 config 所有者;timelock 必须调用 acceptOwnership,而且应该在正式接受所有权之前先注入流动性。
它面向哪些链?BNB Smart Chain 主网(chain id 56)和测试网(chain id 97)。在主网上,GILD 代币必须已经是 Flap 曲线代币(status 1)或已毕业的 Flap 代币(status 4);之后脚本会调用 syncFlap。
Pancake Infinity 上的 hook 权限是怎么回事?权限位并不烧录进 hook 地址里:getHooksRegistrationBitmap() 会被复制进 PoolKey.parameters(低 16 位),tick spacing 占用第 16-39 位。不要把 Uniswap v4 的地址标志位照搬到这里这个 hook 上。
收起来的手续费去了哪里?FeeCollector.forwardToBuyback 会把扫走的 WBNB 转给回购合约,由它执行区间回购;TOKENOMICS.md 记录了 Flap 启动发行的 GILD 供应量以及手续费销毁路径。
Size
0.1 MB
Stars
196
Updated
CommitOct 03
Age
17d
Commits · 90 Days