Fixed-supply ERC-20 creation, Uniswap V3 liquidity seeding, and stock-token distributions for ArchLiquid.
Status: Testnet preview. These contracts have not been audited by an external security firm. Review the source and run the test suite before interacting with a deployment.
| Contract | Purpose |
|---|---|
ArchToken |
Fixed-supply ERC-20 with immutable AMM-trade fees and magnified stock-token dividend accounting. |
ArchTokenFactory |
Creates a token, optionally seeds a full-range Uniswap V3 position, and burns or time-locks that position in one transaction. |
taxed AMM trade
│
v
ArchToken accumulates its own tokens
│ keeper supplies explicit minimum outputs
v
token/WETH swap ──> creator leg, when configured
│
├── 10% protocol share ──> treasury
│
└── holder share ──> stock-token purchase
│
v
pro-rata holder claims
Holder accounting moves future distribution rights with token balances while preserving already-earned claims for the prior holder. Market pairs, the factory, lockers, the token contract, and the burn address are excluded from dividends.
| Parameter | Enforced value |
|---|---|
| Trade tax | 1% to 5% (100..500 basis points) |
| Optional creator fee | 0% to 1% (0..100 basis points) |
| Maximum combined fee | 6% (600 basis points) |
| Protocol share of the post-creator distribution pool | 10% |
| Creator inactivity window | 30 days |
| Minimum supply percentage seeded as liquidity | 10% |
| Minimum V3 position lock | 180 days when liquidity is locked rather than burned |
| Supported V3 fee tiers | 100, 500, 3000, or 10000 |
The token has no owner, no mint function, and no blacklist. Factory wiring is
available only during creation and becomes permanent when finalizeWiring() is
called.
Versioned factories may bind one reviewed post-deployment liquidity provisioner
during that wiring window. A token created without a market can then register
exactly one deferred first market through registerInitialMarketPair(). The
binding cannot be replaced after wiring, additional markets cannot be added,
and tax exemptions remain factory-only wiring actions.
git clone --recurse-submodules https://github.com/ArchLiquid/archliquid-token.git
cd archliquid-token
forge build
forge test
forge build --sizesThe exact Solidity version, optimizer, EVM target, and first-party remappings
are defined in foundry.toml.
The selected stock must already be approved by the factory's
ArchStockRegistry. The transaction value is the immutable factory fee plus
the ETH used to seed liquidity.
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ArchTokenFactory} from
"@archliquid/token/ArchTokenFactory.sol";
ArchTokenFactory.TokenParams memory tokenParams =
ArchTokenFactory.TokenParams({
name: "Arch Example",
symbol: "ARCHX",
totalSupply: 1_000_000 ether,
taxBps: 300,
stock: IERC20(approvedStockToken),
creatorFeeBps: 50
});
ArchTokenFactory.LiquidityParams memory liquidity =
ArchTokenFactory.LiquidityParams({
enabled: true,
lpPct: 70,
poolFee: 3000,
burnLp: false,
lockDuration: 365 days
});
address token = factory.createToken{
value: factory.FEE() + 10 ether
}(tokenParams, liquidity);Set burnLp: true to send the V3 position NFT to the fixed dead address. In
that mode lockDuration is unused. Set enabled: false and send only FEE to
create without a pool; the complete supply is then transferred to the creator.
The factory rejects a pre-initialized pool whose price does not match the requested seed ratio. A failed creation leaves the transaction atomic: no fee, ETH, token supply, or liquidity position is partially committed.
import {ArchToken} from "@archliquid/token/ArchToken.sol";
ArchToken archToken = ArchToken(payable(token));
uint256 available = archToken.withdrawableDividendOf(holder);
if (available > 0) {
archToken.claimFor(holder);
}Anyone may call claimFor(holder), but the stock tokens always transfer to
holder. A holder can call claim() directly.
Only the immutable KEEPER can process accumulated trade fees. Every route
requires caller-provided minimum outputs.
For a sufficiently liquid direct stock/WETH V3 pool:
archToken.processDistribution(minWethOut, minStockOut);For an aggregator route through the immutable constrained executor:
archToken.prepareDistribution(minWethOut);
// Quote the exact prepared WETH balance off chain, then submit aggregator
// calldata that sends output to the configured executor.
archToken.processDistributionViaExecutor(minStockOut, swapData);The second step requires the executor to consume the complete prepared WETH balance. The executor measures stock output and refunds unused WETH; the token rejects a distribution if any prepared WETH remains.
When creatorFeeBps is nonzero, the configured recipient can pull accrued ETH:
archToken.claimCreatorFee();
archToken.setCreatorFeeRecipient(newRecipient);The current recipient alone can claim or hand the stream to a nonzero new
recipient. If accrued creator fees remain unclaimed beyond 30 days, anyone may
call revertCreatorFeeToHolders(). That permanently disables the creator leg
and folds the stranded value into a later holder distribution.
ArchTokenFactory is configured once with:
- a fee treasury and distribution keeper;
- the Uniswap V3 position manager, swap router, and WETH;
- the stock/WETH fee tier;
- an
ArchV3PositionLocker; and - an
ArchStockRegistrywhose selected executor is snapshotted by each new token.
The factory should be authorized as fee-exempt on the V3 locker before users create locked-liquidity tokens.
| Dependency | Commit |
|---|---|
| ArchLiquid Core | b1f0bec05bdee32cdcb3dfa74310f2f5476760be |
| ArchLiquid Lockers | a91771ca0ff37598fe79e4a01d214459bfeddb20 |
| Foundry standard library | c179529c064588ede54a0661ec3cc98219460d07 |
| OpenZeppelin Contracts | 5fd1781b1454fd1ef8e722282f86f9293cacf256 |
The suites cover factory atomicity, approved-stock enforcement, V3 pool-price griefing, LP burn and lock paths, immutable wiring, one-time deferred market registration, provisioner authorization, fee bounds, taxed AMM transfers, direct and executor distributions, holder accounting, creator fee claims, voluntary handoff, and inactivity-based reversion.
forge fmt --check
forge test -vv
forge build --sizesRead SECURITY.md before reporting a vulnerability. Use GitHub's private vulnerability reporting flow; do not publish exploit details in an issue.
Copyright (c) 2026 ArchLiquid. This repository is public source, not open
source. No permission to use, copy, modify, compile, deploy, or distribute the
materials is granted without prior written approval. See LICENSE.
Files marked LicenseRef-ArchLiquid-Proprietary are governed by that license.