AVOQ ($VOQ) Security Dossier
The internal verification suite in full detail: what was run, what each number means, what the one skipped test is, and how every finding was judged.
ARCHITECTURESecurity architecture
What the contracts are built on, in four pillars. The numbers and the full detail follow below.
SUMMARYThe numbers
Every number on this page comes from a raw tool output. Where a result needs context, the context sits next to the number.
SCOPEWhat was reviewed
| Item | Value |
|---|---|
| Contracts | AVOQToken.sol and AVOQPresale.sol, 776 lines of code |
| Compiler | solc 0.8.24, optimizer on (200 runs), EVM shanghai |
| Source hashes (md5) | Token 39bdf05994deffac35030cce95fb957f, Presale 8b7691ab21417a2c52410f043d4f4ed5 |
| Deployed | Ethereum mainnet. Token 0x655807349Fa51CBcB96CBF52f014e74512C1075F, Presale 0x14335472c1325672f4f3E4B18803f5bBb946182B |
01The test suite: 442 passed, 0 failed
The Foundry suite has 27 test suites. Each test is a small program that calls the contract and checks the outcome, for example “a purchase above the wallet limit must revert”. It covers unit tests, integration flows (deploy, presale, airdrop, trading, fee swap), attack scenarios against the Uniswap pair, mutation killers, invariants and one exact-message test for every revert message.
MutantKillers2PresaleTest (it inherits them from PresaleTest), plus 10 standalone mainnet-fork tests (section 2).The log is in reports/forge_test_442_2026-11-14.log. Before the 90 extra revert-message tests were added, the suite stood at 352 passed.
02The one skipped test, explained
Foundry reports “443 tests: 442 passed, 0 failed, 1 skipped”. The one skipped item is not a failing test that was switched off. It is the whole ForkUniswapTest suite.
What it is
test/ForkUniswap.t.sol holds 10 tests (the original 9 and, since 24 November 2026, an extended five-size sandwich test) that run our contracts against the real Uniswap V2 (the router, factory, pair and WETH9 contracts) on a fork of Ethereum mainnet. The contracts are placed only in the memory of the fork and nothing is ever sent to the network.
Why it shows as skipped
These tests need a mainnet RPC connection. In the normal offline run there is no fork, so the real Uniswap router does not exist, and the suite’s setUp() skips itself on purpose (ROUTER.code.length == 0). Foundry counts that as one skipped item. This keeps the normal suite fast and offline.
How it was run instead
The suite was run separately on a mainnet fork three times: on 12 November 2026 at block 26395818, on 18 November 2026 at block 26444489 against the final deployed source (the same md5 as on mainnet), and on 24 November 2026 at block 26485938 after the five-size sandwich test was added. The first two runs: 9 passed, 0 failed. The third run: all 10 tests passed, 0 failed.
forge test --match-path test/ForkUniswap.t.sol --fork-url <RPC> --fork-block-number 26485938
What the tests check:
- The real router fails after a WETH donation plus sync, and a direct mint still works, so a donation becomes part of our pool and the attacker cannot take the WETH back.
- An unsynced donation does not break the router path.
- A buy and a sell through the real router pay the 4% fee: the receiver gets about 96% of the quote.
- The fee swap runs on the real router and pays marketing and team in ETH.
- Sandwiching the fee swap loses money for the attacker in every size tested, at 5 evenly spaced sizes from 100B tokens up to the 10,000B MAX_TX limit (24 November 2026, table below). The older three-size test (2,000B, 5,000B, 10,000B) still passes. The same scenarios give the same numbers in our local copy of Uniswap, so the local model is faithful for these flows.
- Removing all liquidity (200,000B tokens and 800 ETH) works by a direct burn on the pair without any exemption, and through the real router with a temporary router exemption.
Sandwich simulation at five sizes (24 November 2026)
So that nobody can say only favourable sizes were tried, the sandwich was run at five evenly spaced front-run sizes from a small minimum up to the absolute MAX_TX_AMOUNT of the contract (10,000B tokens, 1 percent). Setup: pool of 800 ETH and 200,000B tokens, trading enabled, the attacker holds 15,000B tokens, a victim sells 2,500B and that sale triggers the automatic fee swap. The attacker sells the front-run amount before the victim and buys back with the proceeds after it. The test ran at mainnet block 26485938 against the real Uniswap V2 router, factory, pair and WETH9.
| Front-run size | ETH from the front-run sale | Attacker P&L with the attack | Attacker P&L without any attack | Net effect of the attack |
|---|---|---|---|---|
| 100B | 0.3827 | −1.6849 | −1.4088 | −0.2761 |
| 2,500B | 9.4580 | −2.1895 | −1.4088 | −0.7807 |
| 5,000B | 18.6951 | −2.7255 | −1.4088 | −1.3167 |
| 7,500B | 27.7187 | −3.2717 | −1.4088 | −1.8629 |
| 10,000B (MAX_TX) | 36.5363 | −3.8277 | −1.4088 | −2.4189 |
All amounts are in ETH, to four decimals. The “net effect” column is the real result of the attack: the attacker’s result with the attack minus the −1.4088 ETH that the victim’s sale and the fee swap it triggers already cost the attacker’s 15,000B token bag at the new pool price, with no attack at all. A sandwich only pays if the net effect is above zero. It is below zero at all five sizes, and the bigger the attack, the bigger the loss, because every sale and every purchase pays the 4% transfer fee. The test asserts this for each size.
Which code was tested. The runtime bytecode of the deployed token 0x655807349Fa51CBcB96CBF52f014e74512C1075F was compared with the build used in the test: the same length (13,662 bytes) and byte for byte the same, except for 23 blocks of exactly 20 bytes. Those are the address constants (the router and the wallets) that are set when the contract is deployed. All other code is identical.
reports/sandwich_5_sizes_2026-11-24.md, reports/sandwich_5_sizes_2026-11-24_trace.log, reports/ForkUniswap_all_block26485938_2026-11-24.log). The fresh run of 18 November 2026 used the final deployed source and archived its log (reports/forge_fork_ForkUniswap_2026-11-18_block26444489.log). The loss figures are reproduced in the fresh run (reports/forge_fork_sandwich_2026-11-18_block26444489_vvvv.log). The same scenarios are also covered offline in PairAttack.t.sol, which is part of the 442.03Fuzzing: hostile inputs at scale
Foundry fuzz tests
A fuzz test picks random inputs (amounts, addresses) and looks for a broken rule. Foundry runs 256 per test by default. We raised it to 100,000 per test. With 17 fuzz tests that is about 1.7 million cases, all passed. This 100,000-run pass was measured while the suite had 352 tests. The 90 newer tests ran in the normal mode.
Echidna, a property fuzzer
Echidna (open source, by Trail of Bits) chains random calls and checks that stated properties always hold. The two runs are reported separately because they are two separate harnesses with different properties.
| Contract | Calls | Properties | Result |
|---|---|---|---|
| AVOQToken | 500,040 | 6 | 6 of 6 held |
| AVOQPresale | 400,000 | 8 | 8 of 8 held |
The properties that must always hold
| Token (6) | Presale (8) |
|---|---|
|
|
The presale harness used 64 buyers plus an owner and covered 12,176 instructions. Complementary coverage: Echidna drives 64 parallel buyers in that run (400,000 calls), while the exact 1,500 ETH cap boundary is covered by the formal proofs (section 7: the full cap equals the whole inventory) and by Foundry tests.
“Held” means Echidna did not find a counterexample in that many attempts.
04Mutation testing: 68 of 69 planted bugs caught
Idea: break the code on purpose in one place (a “mutant”) and check that some test fails. If every test still passes, the mutant survived, which means a gap in the tests. We planted 69 mutants, such as “owner check off”, “cap check off by one”, “reentrancy lock off”, “max wallet off” or “trading enabled twice”.
- First round: 62 caught, 7 survived.
- We then wrote targeted tests for the survivors. 6 of them (M19, M37, M46, M56, M66, M67) are now caught, each by a specific test.
- 68 of 69 are caught: 98.5%.
The one that remains: M40
M40 is “zero owed not skipped”. The airdrop loop normally skips recipients who are owed nothing, which only saves gas. The mutant stops skipping them. Behaviour and state are the same, only the gas use differs, so it is a gas-only difference, not a logic bug. A test catches it through a gas ceiling, but we do not count that as a clean kill because it depends on gas.
A further variant (M56b) is an equivalent mutant: it changes the code but not the behaviour for any input, so no test can catch it. It is not part of the 69.
Files: reports/mutation_results.json (final) and reports/mutation_results_before_killers_2026-11-13.json (earlier state).
05Revert messages: 74 of 74
A script read every require(..., "message") and revert("message") in both contracts: 38 distinct messages in the presale and 36 in the token. Before the extra tests, 15 presale messages and 19 token messages had no test that expected them. We added 90 tests (GapsClosed.t.sol), each triggering exactly one message with vm.expectRevert(bytes("message")) and checking the real effect. Messages that appear at several places are covered for each place, and every condition joined by || or && was tested on its own.
Result: 0 messages without a test. The full message-to-test table is in triage/MATRIX_messages_to_tests.md.
06Coverage: reading the numbers correctly
| File | Lines | Statements | Functions | Branches (tool) |
|---|---|---|---|---|
| AVOQPresale.sol | 99.47% (189/190) | 99.13% | 100% | 40.91% |
| AVOQToken.sol | 99.29% (281/283) | 99.02% | 100% | 36.22% |
Why the branch percentage is not the right measure
The coverage tool counts each require as two branches, but it does not count the failing side, because a call that reverts leaves no trace for it. Most “uncovered” branches are exactly those failing sides. We proved this: after adding 90 tests that trigger every one of them, the branch percentage barely moved. That is why we publish the message-by-message result above instead, which measures what we actually want.
The few lines the tool marks as not executed
| Line | Verdict |
|---|---|
Presale _enableClaims() inside enableClaims() | Executed. A trace of the test shows ClaimsEnabled being emitted, and that event exists only in this function. |
Token _swapBack() on a taxed sell | Executed. The trace shows the router swap call and the SwapAndLiquify event. |
Token payout ok := call(...) (inline assembly) | Executed. The trace shows the call to a receiver that reverts and then PayoutFailed. The tool cannot instrument inline assembly. |
Token line 544 return (_rTotal, _tTotal) | Unreachable by construction. The sum of all _rOwned always equals _rTotal (checked with a fuzz test). |
Token line 616 _tOwned[this] += tLiquidity | Reachable only if the contract excluded itself from rewards, which the code never does. A test builds such a deployment to run it. |
Measured with forge coverage --ir-minimum, which changes the compilation and can misplace line numbers, so we do not claim “100% lines”. We claim 99.5% and 99.3%.
07Formal proofs (Halmos)
Testing tries inputs. Halmos, a symbolic executor backed by SMT solvers, tries to prove that a rule holds for every input.
Proven for all inputs (4)
- Cap equals inventory: buying the full 1,500 ETH cap yields exactly the whole presale inventory.
- Blocks add up: the token amounts of the five blocks sum exactly to the inventory.
- Block 0 never over-sells its inventory.
- Block 0 never gives more than its block total.
Solver scope and complementary fuzzing
The same checks for blocks 1 to 4, and the cross-block checks, did not finish within the solver’s limits, so they are not claimed as proven. The tier math multiplies and divides 256-bit numbers inside a loop, a known hard case for SMT solvers (nonlinear arithmetic): the runs reached 5 to 8 GB of memory and were stopped. Splitting the input range does not help, because the difficulty comes from the structure of the calculation, not the size of the range.
How those properties are covered instead
By the Foundry fuzz tests (TierProps.t.sol, MathTable.t.sol) and the Echidna presale harness, which checks that every buyer owns exactly what was bought, bonus included. This is empirical evidence, and we describe it as such. A complete proof would be split into lemmas, which is several days of work; we judged it better spent on an external audit.
The calculation rounds down at every step, so splitting a purchase into pieces can never give more tokens than one purchase.
08Static analysis: every result judged
Slither (Trail of Bits): 35 findings, 0 open, 0 vulnerabilities
Slither reads the source code and flags suspicious patterns. All 35 findings were reviewed by hand. 19 are false positives, each with its reasoning or proof, and 16 are real observations that are intentional design, each with a reason.
| Verdict | Count | Reasoning |
|---|---|---|
| FALSE POSITIVE | 10 | Guard proven: _inSwap mutex; killer tests MutantKillers2 (nested sell/manualSwap during payout and router callback) and mutants M66/M67a/M67b killed; Echidna 500k calls clean |
| FALSE POSITIVE | 5 | Integer floor division. Remainder is never lost: lpEth = gained - marketingShare - teamShare, lTokens = amount - mTokens - tTokens. Error <= 1 wei per division |
| FALSE POSITIVE | 1 | Strict equality on the function argument (amount == 0 early return), not on a balance an attacker can force |
| FALSE POSITIVE | 1 | Return values unused on purpose: ETH gained is measured by balance delta; addLiquidityETH sits in try/catch; failure only keeps funds in the contract |
| FALSE POSITIVE | 1 | _inSwap written true then false by design (mutex set/reset around one call); both writes needed |
| FALSE POSITIVE | 3 | Zero address intended: transferOwnership(0) cancels a pending handover (documented in NatSpec); token constructor value comes from `new`, never zero |
| BY DESIGN | 1 | distributeTokens is owner-only batch to the project's own token; a failing recipient is skipped, batch size chosen by owner |
| BY DESIGN | 1 | Events-only ordering finding in owner-only claimOtherTokens; no state is affected |
| BY DESIGN | 5 | Deadlines and windows are meant to use block.timestamp; a miner can shift it by seconds, windows are days |
| BY DESIGN | 1 | Assembly call is deliberate: limited gas and no return-data copy (return-bomb protection) |
| BY DESIGN | 5 | Low level call/ETH transfer is deliberate, with checks and nonReentrant where the user can reach it |
| BY DESIGN | 1 | Name WETH() belongs to the external Uniswap interface, cannot be renamed |
The raw tool still prints 35 warnings, which is why the verdict for each is published in triage/TRIAGE.md.
Aderyn (Cyfrin): 50 locations in 9 categories, all judged
Two categories are labelled “High” by the tool. Both are false positives, with reasons below.
| ID | Finding | Verdict | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| H-1 | ETH sent without address check, Presale buyTokens | False positive. The only recipient is msg.sender and only for the excess over the accepted amount. State is written first, function is nonReentrant, a failed refund reverts the whole buy. | ||||||||||||
| H-2 | State change after external call (5) | False positive. Presale openSale: the call is token.balanceOf (a read on our own token), owner only, one time. Token lines 259 to 263: constructor calls to the router and factory; the contract has no code yet, so nothing can re-enter it. Assumes the router address given at deploy is the real one, which is checked at deploy time, not in code. | ||||||||||||
| L-1 | block.timestamp as swap deadline | Accepted limitation. Minimum output is 1 wei by design (a quote from the same call cannot detect a manipulated price). A fee swap can be sandwiched; size is bounded by SWAP_THRESHOLD and swapReserveBps. Measured on a mainnet fork against the real Uniswap V2 router at block 26485938, at five evenly spaced sizes up to the MAX_TX limit (test_fork_sandwich_five_evenly_spaced_sizes_up_to_max_tx): the sandwich lost money for the attacker at every size. The table shows the net effect of the attack, after subtracting the −1.4088 ETH that the victim’s sale costs the attacker’s token bag even without an attack. The tested bytecode matches the deployed contract 0x6558…075F except for its 23 constructor address constants.
| ||||||||||||
| L-2 | Centralization, 18 owner functions | By design, published. Two step ownership, no renounce, recoverTokens cannot touch tokens reserved for buyers, openSale and closeSale are one way. | ||||||||||||
| L-3 | Large numeric literals (5) | Cosmetic. | ||||||||||||
| L-4 | Literal instead of constant (15) | Cosmetic. | ||||||||||||
| L-5 | Address set without zero check (2) | Intentional: zero address cancels a pending handover (documented in the function comment). acceptOwnership requires msg.sender == pendingOwner, so it cannot hand control to anyone. | ||||||||||||
| L-6 | Unchecked return (2) | Intentional: the value is not needed, failure shows as a revert that is caught. | ||||||||||||
| L-7 | Unsafe ERC20 operation (Presale 462) | False positive: the return value is checked with require, the token is our own fixed token. Mutant M46 (check removed) is killed by a test. |
ERC-20 conformance
slither-check-erc: every check passes (functions, return types, view marks, Transfer and Approval events, increaseAllowance).
09Trust model: what the code enforces
Fixed by the code
- Not upgradeable. No proxy, no
delegatecall, noselfdestruct. - Mint-free. The whole supply is created once in the constructor. Fee rates (4%: 1 reflection, 1 marketing, 1 team, 1 liquidity), max transaction (1%) and max wallet (2%) are constants.
- Liquidity share split. Within the 1% liquidity share, 51% of the ETH generated pairs automatically with the remaining tokens to deepen the Uniswap V2 pool (~0.68% effective auto-LP), while 49% of that ETH (~0.32% of each taxed transfer) accumulates in the marketing wallet as an ETH reserve. The split is the fixed constant
LP_MARKETING_ETH_PCT = 49; this way new exchange pools, cross-chain liquidity and listings can be funded from accumulated ETH rather than by selling treasury tokens on the open market. - Trading can be enabled once and can never be disabled.
- The deployer has no power. The constructor rejects the deployer as owner, holder or fee-exempt address.
- The owner is a multisig Safe (2 of 3) with an independent legal signer. Ownership moves in two steps and there is no renounce.
- The presale opens only fully funded. It holds the whole 393,000B inventory before the first purchase, and the owner can never withdraw tokens owed to buyers.
- Direct ETH transfer guard. Plain ETH transfers to the presale contract are rejected by its receive() function with "use buyTokens" (verified on a local test chain using the deployed contract code - before sale opening, while open, and after live purchases). A rejected transfer reverts and the sender keeps the ETH, minus network gas.
What the owner can do
Enable trading (one way), set fee and limit exemptions (never for the pair), set marketing and team wallets, switch the automatic fee swap on or off and set its size within a hard maximum, set the liquidity receiver, run a manual fee swap, exclude a bounded number of accounts (at most 10 in total) from reflection, for example exchange or locker wallets (one way), recover tokens that are not reserved for buyers, and hand over ownership in two steps.
What the owner cannot do
Mint tokens, change the fee rates, change the limits, turn trading off, take tokens owed to presale buyers.
A known limit, stated openly
The automatic fee swap accepts any output above 1 wei, because a price quote taken in the same call cannot detect a manipulated price. So a searcher can try to sandwich it. The damage is bounded: each swap is capped by SWAP_THRESHOLD and by a share of the pool (swapReserveBps), and on the fork the sandwich lost money for the attacker (section 2).
10Scope and next steps
Exhaustive defense-in-depth and empirical verification, establishing an open engineering benchmark ahead of prospective external audits.
- This is an internal verification suite and formal-methods model. An external third-party audit is planned to follow.
- Formal proofs cover four properties of the tier math. The rest of the math is covered by fuzzing.
- Results hold for the tests and mutations we wrote. They are strong evidence, not a guarantee that no unknown issue exists.
11Reproduce it
The review package holds the contracts, all tests, the fuzzing harnesses, every raw tool output and the triage of every finding. The complete review package (contracts, tests, fuzz harnesses, raw logs and triage files) is available on request at contact@avoq.fi.
forge test forge coverage --ir-minimum --no-match-contract InvariantsTest \ --no-match-test "test_nested_sell_during_manual_swap_starts_no_swap|test_nested_sell_during_payout_starts_no_nested_swap|test_zero_owed_recipients_are_skipped_cheaply" echidna fuzzing/EchidnaAVOQ.sol --contract EchidnaAVOQ --config fuzzing/echidna.yaml echidna fuzzing/EchidnaPresale.sol --contract EchidnaPresale --config fuzzing/echidna_presale.yaml slither . --filter-paths "src/base|test|echidna|lib" forge test --match-path test/ForkUniswap.t.sol --fork-url <RPC> --fork-block-number <recent block>
Anything you disagree with in the triage is the most useful feedback we can get. Contact: contact@avoq.fi. Always check the contract address against the official site.